.net programming, computers and assorted technology rants

ASP.Net Web API Supercharges your Web Forms

Courtesy Charles Nurse, DrDobbs

A Simple Web Forms Application

To understand how to supercharge an existing Web Forms application with the ASP.NET Web API, let’s first take a brief look at a Web Forms app that I’ll use as an example. Figure 1 shows the list view of a simple Tasks application, which was created using the new Web Forms template shipped as part of Visual Studio 2012.

Super-Charging ASP.NET Web Form Apps
Figure 1: The Tasks page in list mode.

The Add New Task button and the Edit links in the Grid allow the user to add new tasks or edit the relevant existing tasks.

Assume that you have been given a new requirement: Instead of just displaying the "Is Complete" status of the task, the application should display a checkbox and allow users to update the status of the task (rather than having to click "Edit" and be redirected to the edit page).

You could fulfill this requirement by using a checkbox column in the ASP.NET GridView control and switching the GridView into Edit mode, but this would require the use of server post-backs and would trigger a complete refresh of the grid whenever a task is updated. Instead, let’s use some JavaScript in the client and the ASP.NET Web API to demonstrate how to make the updates more modern and responsive.

Read More:



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s