Looking for an AJAX tutorial on how to use the DynamicPopulate Extender?
Well you are in luck today, were giving you a simple yet extensive tutorial and example how to activate and use this control.
The DynamicPopulate extender is a control which will replace html/content of any control based on the web service result.

To populate you need to create a web service method which has a single parameter with a name of “contextKey”. If you do not specify contextKey variable or you make its name different then your extender will fire error “Web Service call failed: 500″.
DynamicPopulate is an extender that replaces the contents of a control with the result of a Web service or page method call. The method call returns a string of HTML that is inserted as a child of the target element.

-Open Visual Studio 2010
-Add a new WebForm to this project and name it DynamicPopulate.aspx
-Add a ScriptManager to the page. This must always be used in an AJAX Website or Form
-Add the DynamicPopulate extender; then write a webservice method that gets html content and a css class for updating the html content. To populate you need to create a webservice method which has a -single parameter with name “contextKey”. If you do not specify contextKey variable or you make its name different, then your extender will fire the error “Web Service call failed: 500″.
-To populate content you can specify the attribute named PopoulateTriggerControl then specify your control ID.
-Or we can go the JavaScript method and a code will call the populate event of the DynamicPopulate Extender you can use this code below

The above script’s “value” will be passed as a “contextKey” in the webService method.

The markup of the page will look like this:

Load the page in browser and it should look like:

As you can see we Dynamically Populated a Text Box with information from the server without using postback.

This control enables you to use a web service method and populate the data using either JavaScript or by setting the Property ID or passing a value in a web service method.

We encourage you to download the source file to follow along, especially when you’re working with JavaScript as it can get a little hairy sometimes.