Telerik blogs
One of the features added to RadAjax "Prometheus" in the recent service pack was a new control called the RadAjaxManagerProxy. This control enables you to easily Ajaxify controls in your UserControls without worrying about adding multiple RadAjaxManagers to a page.

Background
Most RadAjax developers would probably say that Ajaxifying UserControls is one of the more difficult aspects of adding Ajax to an ASP.NET application. Even with good documentation, it is difficult to decide whether you should add an AjaxManager to each UserControl or handle all UserControl Ajax settings programmatically from a parent container. The big drawback of the later option (which is usually the better option) is that you lose the codeless configuration experience that makes RadAjax so easy to use. There has to be a better way to visually configure your Ajax settings in an UserControl and not worry about conflicting RadAjaxManagers.

RadAjaxManagerProxy
If you are familiar with ASP.NET AJAX, then you know that every ASP.NET AJAX page requires a single ScriptManager to function correctly. Most sites that are built with MasterPages simplify this by placing the ScriptManager in the MasterPage so that all ContentPages automatically work with ASP.NET AJAX. To add additional settings to the ScriptManager in a ContentPage, a control called the ScriptManagerProxy is used to declaratively set additional settings. At run time, the ScriptManager looks for instances of the ScriptManagerProxy in child containers and automatically loads any settings it finds.

So it is with the RadAjaxManager and the new RadAjaxManagerProxy. You can now (with no hesitation) add a single RadAjaxManager to your MasterPage and then use RadAjaxManagerProxies in ContentPages and UserControls to configure your Ajax interactions. No more worrying about multiple RadAjaxManagers on the page. No more hand coding to ajaxify all of your UserControls. The RadAjaxManagerProxy gives you the full codeless design-time configurator that's available with the RadAjaxManager, and the RadAjaxManager automatically loads all Proxy settings at run time.

Scenarios
Let's look at some scenarios to see what's possible with this new "magic" control:
  • If you have a RadAjaxManager on a MasterPage, all Ajax settings on ContentPages and UserControls can be set using the RadAjaxManagerProxy.
  • If you define an AjaxLoadingPanel in your MasterPage, you can use it in your ContentPages and UserControls without any problems (as long as you know its control ID)
  • If you define an AjaxLoadingPanel in your ContentPage, you can use it in your page's RadAjaxManagerProxy without any problems
  • If you're not using MasterPages, you can place a RadAjaxManager in a regular ASP.NET page and all UserControls can continue to use the RadAjaxManagerProxy.

Live Examples
Rather than include code snippets in this article, I think it would be better for you to see the RadAjaxManagerProxy in action. Check out the new online demos in the RadAjax "Prometheus" section to see this new control running live and then download these sample applications to inspect the code for yourself. The RadAjaxManagerProxy is part of the Q1 2007 SP1 update for RadControls "Prometheus", so you can download your dev copy today from Client.net.

Wrap-up
The new RadAjaxManagerProxy should eliminate a lot of the headaches that are normally suffered when working with UserControls and Ajax. If you've been waiting for a good reason to check out the new ASP.NET AJAX-based "Prometheus" Ajax, this is definitely a good time to take the plunge. Enjoy the new Ajax control and be sure to share your feedback in the official RadAjax forums!


ToddAnglin_164
About the Author

Todd Anglin

Todd Anglin is Vice President of Product at Progress. Todd is responsible for leading the teams at Progress focused on NativeScript, a modern cross-platform solution for building native mobile apps with JavaScript. Todd is an author and frequent speaker on web and mobile app development. Follow Todd @toddanglin for his latest writings and industry insights.

Comments

Comments are disabled in preview mode.