O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

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 Data Templates

Often the data returned from a web service is an array of similar items. This is especially true when dealing with tables. In this section, we will create a web service that generates the content for the table in the ListEvents.aspx page, obtain the data using Ajax, and then use a jQuery extension created by Microsoft to integrate the data into the page.

Creating the Web Service

We can extend our existing web service to support the ListEvents.aspx page by adding another method to the service code-behind class and decorating it with the same attributes we used in the previous example. Listing 11-7 shows these additions; I have removed the bodies from the existing method and result type for brevity.

Listing 11-7. Adding a ...

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