Thursday, August 23, 2007

Add ASP.NET AJAX Features to an Existing Web Application:

First you must install ASP.NET 2.0 AJAX Extensions 1.0. To do this go to http://asp.net/ajax/downloads/ and you will find link to Download this. If you need to take advantage some other extensions you may want to download the AJAX Control tool kit.

This installation will add System.Web.Extension.dll to your GAC.

1. Load an existing .NET Web application
2. you need to Modify the web.config with few important sections.
3. The easiest way to do that is, create a "Ajaxenabledwebsite" by opening a new instance of Visual studio
and open the Web.config. Copy these sections:

<configsections> element,
<controls> tag wires the tagPrefix all of the things that live in the server side controls for the microsoft Ajax extension
replace the entry - add's assemby to System.web.Extensions

<httphandlers>

I didnt copy this portion and Ajax worked fine. so this should be fine, but the video suggested to copy
them too
<httpmodule>
<system.webserver>
<system.web.extensions>

4. Now go to your webPage's design and drag&drop the scriptManager on to the page.
5. There can be only one ScriptManger for a ASP.NET Page that is going to use Ajax and it is a must

6. Drag and drop a UpdatePanel and move all the content you want to ajax enable into this

7. Include Trigger functions to specify on which event you will need to fire the ajax

quick link for video demo of the same article

No comments: