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

AJAX Master page question

3 Answers 97 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 17 Jan 2012, 09:14 PM
We're in the process of evaluating the ASP.NET AJAX package.  I downloaded the trial version (Q3 2011), and have a question regarding where some of the AJAX controls go.

I'm using the build-in Web Forms app in Visual Studio 2010.  In the Master page, I have a regular Menu control which I load via code.  I understand I need to put the RadAJAXManger & RadAJAXLoadingPanel in the Master page.

Question.  Do I replace the ToolkitScriptManager with RadAJAXScriptManager?

When the user clicks one of the Menu items in the Master page, I raise a "menu clicked" event.  The content page consists of several User Controls.  In that content page, I subscribe to that "menu clicked" event.  When triggered, that event calls a SQL stored procedure to retrieve the data, then passes that data to a User Control which then populates a RadGrid via DataSource/DataBind.  I'm using a lot of User Controls because each can be used more than once on several different pages.

Question.  Where should I place the RadAJAXManagerProxy...in the content page...or within the User Control itself?

In most of your examples, the control that triggers the AJAX request and the control that gets updated are in the same page.  Is there a link to some sample code that might help in the situation I've described above?  Thanks for your help.

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 19 Jan 2012, 03:34 PM
Hello David,

 Note that the in order to have the RadAjax components works correctly on the page you should use RadScriptManager instead of the ToolkitScriptManager.
As for the user controls ajaxification as you mentioned you should place the RadAjaxManager on the MasterPage.
 Depends on the controls you need to ajaxify there could be a RadAjaxManagerProxy on the content page and ajaxify the whole UserControls there, which will force all controls in the ascx files to perform ajax.             
 Another possibility is to avoid the usage of RadAjaxManagerProxy and add programmatic settings in the userControls you need for the specific components you need by getting reference to the main RadAjaxManager. This could be easily done by using the RadAjaxManager.GetCurrent() method to access the manager and apply the needed settings programmatically as described here.

 You could also review the following online resources which elaborates on similar scenarios:
http://www.telerik.com/help/aspnet-ajax/ajax-user-controls.html
http://www.telerik.com/help/aspnet-ajax/ajax-masterpage.html
http://www.telerik.com/help/aspnet-ajax/ajax-masterpage-update-everywhere.html



Greetings,
Maria Ilieva
the Telerik team
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 their blog feed now
0
David
Top achievements
Rank 1
answered on 19 Jan 2012, 10:01 PM
Thanks Maria.

Followed your suggestions.  I replaced ToolkitScriptManager with RadScriptManager and decided not to use RadAjaxManagerProxy within the content/user control pages.  Instead, I'm getting the "master" instance of RadAjaxManager in Form_Load() of the content page itself, and setting it's properties there.  Works like a charm!

I did have one issue in that I was getting the following javascript error on the Microsoft Menu control that I had ajaxified,

get_postBackElement().id' is null or not an object

I Googled a bit and found out if I set that control's "clientIDMode=AutoID", that took care of the problem.  Not sure if it's better to set this at the individual control level, or set it in the Pages section of web.config.  Suggestions?

Thanks again.

David



0
Maria Ilieva
Telerik team
answered on 20 Jan 2012, 03:29 PM
Hello David,

There shouldn't be problems in adding the ClientIDMode setting on a specific control. However note that all RadControls works properly only with AutoID mode and all controls which collaborates with the RadControls (for example control's updated by the RadAjaxManager) should have "ClientIDMode" set to "AutoID" 

All the best,
Maria Ilieva
the Telerik team
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 their blog feed now
Tags
Ajax
Asked by
David
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
David
Top achievements
Rank 1
Share this question
or