You can use the
RadAjaxManager control or another control that initiates postbacks to initiate your own AJAX requests explicitly on the client. It gives you the ability to add AJAX functionality to controls that are not specially designed to make AJAX requests or mark a server control as an initiator of the AJAX request using the
ajaxRequestWithTarget(controlUniqueId, arguments) method.
In this example, you can see integration between a Flash object and the RadAjaxManager and RadListBox controls. When a user clicks upon fixed regions, an AJAX request is made with an argument whose value is the name of the area. The result is a short description of the selected continent or country:
//This method is invoked from the Flash animation.
function
InitiateAsyncRequest(arguments)
{
var
ajaxManager = $find(
"<%= RadAjaxManager1.ClientID %>"
);
ajaxManager.ajaxRequest(arguments);
}
When choosing countries from the RadListBox, the ajaxRequestWithTarget method is invoked to display a description for the relevant country in the description area below:
//this method is invoked from the OnClientSelectedIndexChanged event of the RadListBox control
function
RefreshDescription(sender, eventArgs)
{
var
ajaxManager = $find(
"<%= RadAjaxManager1.ClientID %>"
);
ajaxManager.ajaxRequestWithTarget(
"<%= CountriesListBox.UniqueID %>"
, sender.get_selectedItem().get_text());
}