This is a migrated thread and some comments may be shown as answers.

Moving RadAjaxManager to MasterPage

2 Answers 155 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
jwhitley
Top achievements
Rank 1
jwhitley asked on 08 Aug 2013, 01:04 PM
I need to add a RadAjaxManager to my master pages, and so need to remove them from the content pages.

My questions is, the current RadAjaxManagers in the content pages have AjaxSettings code specific to the individual pages, detailing which controls get updates based on the control being accessed. How to I replicate this code for each page in the master page?

Thanks.

2 Answers, 1 is accepted

Sort by
0
jwhitley
Top achievements
Rank 1
answered on 09 Aug 2013, 10:28 AM
I now have this working (but not fully tested). Not sure it is the best approach, but..

The RadAjaxManager now only appears on the master page. On the content page, where ajax settings are required, I have a public reference to the master page RadAjaxManager and call the RadAjaxManager.AjaxSettings.Clear(); method, then programmatically add them back using RadAjaxManager.AjaxSettings.AddAjaxSetting() method.

Not sure if Page_Load is the right event to be doing it, or if clearing and reloading on every occurrence of the event is the best approach, but while no AjaxSettings need to be added in the master page itself, it seems to do the job.
0
Konstantin Dikov
Telerik team
answered on 13 Aug 2013, 11:48 AM
Hello John,

The Content page Page_Load event handler is the right place to add AjaxSettings to the RadAjaxManager, but you don`t need to call the AjaxSettings.Clear() method as this will remove every ajax settings in the manager. 

For more information on ajaxifying controls in Master/Content page scenarios, please refer to the following help articles:

Hope this helps.

 
Best Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Ajax
Asked by
jwhitley
Top achievements
Rank 1
Answers by
jwhitley
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or