AJAX Master page question

4 posts, 0 answers
  1. David
    David avatar
    16 posts
    Member since:
    Jan 2012

    Posted 17 Jan 2012 Link to this post

    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.
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 19 Jan 2012 Link to this post

    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
  3. David
    David avatar
    16 posts
    Member since:
    Jan 2012

    Posted 19 Jan 2012 Link to this post

    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



  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 20 Jan 2012 Link to this post

    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
Back to Top