O'Reilly logo

ASP.NET jQuery Cookbook by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using jQuery Templates to display data

Let's begin with the basics of defining inline templates in ASP.NET pages. We will create some sample data and then apply the same to the template.

Getting ready

  1. Add a new web form Recipe1.aspx to the current project.
  2. We will define an Employee array on the client side containing data fields such as EmployeeID, Name, Email, and Contact. A snippet of the array structure is as follows:
    var EmpData = [
    { EmpID: "I53434",
    Name: "Richard Tan",
    Email: "richard@someemail.com",
    Contact: "+65 24242444"}
    ];
    
  3. We aim to display this data using templates in the following format:
    Getting ready
  4. Define the corresponding ASPX markup to define ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required