Understanding AJAX and ASP.NET

  • 5/15/2010

Chapter 23 Quick Reference

To

Do This

Enable a Web site for AJAX

Normal Web sites generated by Visual Studio 2010’s template are AJAX-enabled by default. However, you must add a ScriptManager to a page before using any of the AJAX server-side controls.

Implement partial page updating in your page

From within an ASP.NET project, select an UpdatePanel from the toolbox. Controls that you place in the UpdatePanel will trigger updates for only that panel, leaving the rest of the page untouched.

Assign arbitrary triggers to an UpdatePanel (that is, trigger partial page updates using controls and events not related to the panel)

Modify an UpdatePanel’s trigger collection to include the new events and controls. Highlight the UpdatePanel from within the Visual Studio designer. Select the Triggers property from within the property editor. Assign triggers as appropriate.

Implement regularly timed automatic posts from your page

Use the AJAX Timer control, which will cause a postback to the server at regular intervals.

Use AJAX to apply special UI nuances to your Web page

After installing Visual Studio 2008, you can create AJAX-enabled sites, and use the new AJAX-specific server-side controls available in the AJAX toolkit. Select the control you need. Most AJAX server-side controls may be programmed completely from the server. However, some controls require a bit of JavaScript on the client end.