RadAjax for ASP.NET

Using the ResolveUpdatedControls event Send comments on this topic.
See Also
AJAX Manager > How-To > Using the ResolveUpdatedControls event

Glossary Item Box

In some scenarios you might need to initiate ajax request from control that will no longer be available when the updated html for the page comes in. For example this is the case when you load new user control on the place of the old one, and the initiator will be no longer available since the old user control is replaced. Then the ajax controls will throw an error:

The raising postback control with ID <The_ID_Of_The_Control> cannot be found.
Please handle the ResolveUpdatedControls event and set args.SuppressError to 'true' if the control has been unloaded.

For such cases you can handle the ResolveUpdatedControls event and update the needed controls without the need for the initiator control:

C# Copy Code
protected void RadAjaxManager1_ResolveUpdatedControls(object sender, Telerik.WebControls.UpdatedControlsEventArgs e)
{
e.UpdatedControls.Add(
new AjaxUpdatedControl("control_id", "loading_panel_id"));
e.SuppressError = true;
}  
VB.NET Copy Code
Protected Sub RadAjaxManager1_ResolveUpdatedControls(ByVal sender As Object, ByVal e As Telerik.WebControls.UpdatedControlsEventArgs)
 e.UpdatedControls.Add(New AjaxUpdatedControl("control_id", "loading_panel_id"))
 e.SuppressError = True
End Sub

where the control_id is the control that will be updated and loading_panel_id is the corresponding LoadingPanel. The e.SuppressError is needed in order to suppress the error message above thrown by the Ajax control.

 

 

You cannot specify loading panels for the controls that you add to the UpdatedControls collection here. In order to display the loading panels the RadAjaxManager needs to know which are the updated controls prior to sending the Ajax request to the server (so it can apply the loading panels while the request is in progress). However, when handling the ResolveUpdatedControls server-side event you are modifying the UpdatedControls collection on the server-side when the Ajax request is already in progress. 

In such scenarios we would suggest you to use sticky loading panels -- you would not get individual visual tip for each updated control but you would still get an indication that the page content is updated.

More useful examples could be found attached in this forum thread or in the following Telerik RadAjax Code Library projects and KB articles.

See Also