RadMultiView, User controls and AJAX

9 posts, 0 answers
  1. Patrik Johansson
    Patrik Johansson avatar
    274 posts
    Member since:
    May 2010

    Posted 13 Apr 2011 Link to this post

    We are using a masterpage which has a RadMultiView, and then in each RadPageView, we load a user control (.ascx), which is all controlled by a RadTabStrip (probably doesn't matter). Now, assuming a scenario where each user control would only speak with itself, what would be the best solution, having one master RadAjaxManager in the master page, or having separate RadAjaxManagers in all user controls? And why?

    In alternative 1, we would really wrap in the entire RadMultiView in an updatepanel, in alternative 2, only the controls in each user control.
    Alternative 1 would of course make the whole user control update, alternative 2 would allow more detailed control, but unless you have complex pages with lots of controls (perhaps just a RadGrid in each with a filteroption), the difference all togheter might not be all that large after all?

    What would be the advantages/drawbacks of each solution?

    You could make the question more complex by introducing RadAjaxManagerProxy, but in alternative 1, I guess that wouldn't really make that much of a difference would it, since the entire user control would update anyway? We have experimented a bit with this alternative 3 with a proxy and a radajaxmanager in the master, but then we get a strange problem - when we have a buttonClick_event call myRadGrid.Rebind() after modifying data, we can see that the DataBinding() event of the RadGrid is triggered, the Select is executed in the database....but the contents of the RadGrid isn't updated. Strange.

  2. Patrik Johansson
    Patrik Johansson avatar
    274 posts
    Member since:
    May 2010

    Posted 15 Apr 2011 Link to this post

    Following up on this post, it seems like there is no way to have a RadAjaxManager in each user control as the RadMultiPage will render each user control even if RenderOnlySelectedPage is set to true, which will give an error message about only one RadAjaxManager being allowed on the page.

    So I guess there is no option really than to put the RadAjaxManager in the master page, and use the proxy. Telerik, please confirm this.

    i find that the RadMultiPage is not as usefull as we would like it to be, ideal would be if you had the option of making only one of the RadPageViews actually be active at the same time, but I realize that this might be a difficult task to accomplish.
  3. Patrik Johansson
    Patrik Johansson avatar
    274 posts
    Member since:
    May 2010

    Posted 15 Apr 2011 Link to this post

    We've noticed another problem, when using RenderOnlySelectedPage, it seems like only the default selected RadPageView will work properly. On the other tabs, at least the RadLoadingPanel won't show when clicking a button that is configured to update a RadGrid on the same page. If you turn of RenderOnlySelectedPage though, it will work again. So it seems like the RenderSelectedPageOnly and RadLoadingPanel don't work to well togheter, is this a known problem?

    (This is with all RadPageViews containing a User Control, which in turn contains a RadAjaxManagerProxy and a RadLoadingPanel)

    Update:
    It seems that if we remove the loading panels from each user control, and instead put it in the master and set it as default for the RadAjaxManager, it will work with RenderSelectedPageOnly = true as well....
  4. Patrik Johansson
    Patrik Johansson avatar
    274 posts
    Member since:
    May 2010

    Posted 15 Apr 2011 Link to this post

    Seems like this example also deals with this:

    http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/usercontrol/defaultcs.aspx

    This example has the RadTabStrip and RadMultiPage in the child user control though, we are looking for a similar example where the RadTabStrip and RadMultiPage was in the master page.
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 Apr 2011 Link to this post

    Hi Patrik,

    The best approach in your case is to have one main RadAjaxManager on the MasterPage and set the RadAjaxLoadingPanel as default for this manager as you already found out. You could also avoid using RadAjaxManagerProxy controls in each UserControl by adding their Ajax settings programmatically to the main manager. You could find an instance of this manager by using GetCurrent(Page) method and apply the needed settings in code behind. You could find some useful information on this matter in the online resources below:

    http://www.telerik.com/help/aspnet-ajax/ajax-add-ajaxsettings-programmatically.html
    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-load-user-controls.html



    Kind regards,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Patrik Johansson
    Patrik Johansson avatar
    274 posts
    Member since:
    May 2010

    Posted 20 Apr 2011 Link to this post

    Thanks for your feedback, many usefull links.

    Are there some obvious advantages of adding the Ajax settings programmatically compared to using an RadAjaxManagerProxy?

    Another obvious question....should one use RadMultiPage or not if you want to use AJAX in the year of 2011. Seems lika a RadMultiPage and dynamic loading of users controls share the same purpose, but the RadMultiPage doesn't always seem like the optimal solution for a modern web application, like with AJAX, at least not in all cases.

    Please help us choose the best solution by providing some pros/cons for each solution.
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 26 Apr 2011 Link to this post

    Hello Patrik,


    Using RadAjaxManagerProxy and adding RadAjaxManager settings programmatically are equal solutions in cases the ajaxified controls are always visible on the page. However if the page structure changes dynamically and the ajaxified controls need to be invisible in some stage of the application it is always preferable to use dynamic RadAjax settings. So we always recommend usage of RadAjaxManagerProxy in cases this is possible.
    Regarding the MultiPage controls you are correct that RadMultiPage and dynamic loading of users controls share the same purpose when you are loading UserControl and when the RenderSelectedPageOnly property of the RadMultiPage is set to true. However in cases when the UserControls are declaratively added on the page or you are not using UserControls the implementation of RadMultiPage with RadTabStrip is rather more intuitive and clean and provides easier for revising mark up.
    You could make the best choice which implementation exactly to use depends on what you are trying to achieve and how the application should look.

    Greetings,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  8. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 17 Nov 2011 Link to this post

    Hello,

    I am using version 2011.2.712 of the controls and every time I add my RadMultiPage to the UpdateControls section for my RadTabStrip, I receive a Javascript error. Is it not possible to update the RadMultiPage via AJAX with the version of the controls I am using? 

    Here is my Ajax setting for the RadTabStrip. If I comment out the <telerik:AjaxUpdatedControl /> setting for rmpPOs, then my other ajaxified controls work; however, as soon as I un-comment that setting, I receive an error for any ajax postback that occurs, and it causes the ajax update to fail.
    <telerik:AjaxSetting AjaxControlID="rtsPOs">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="rmpPOs" LoadingPanelID="RadAjaxLoadingPanel1"  />
            <telerik:AjaxUpdatedControl ControlID="rtsPOs" />
        </UpdatedControls>
    </telerik:AjaxSetting>

    Here is the error:
    Microsoft JScript runtime error: 'undefined' is null or not an object.

    Any assistance would be greatly appreciated!

    Thanks,
    Casey

    ***EDIT*** I'm not exactly sure why, but I had to add the rmpPOs AjaxUpdatedControl setting to the AjaxSetting for RadAjaxManager1, and remove another control that I had added to that same AjaxSetting, but it works now...
  9. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 Nov 2011 Link to this post

    Hello Casey,

    I would suggest you to review the following online help topic which elaborates on adding the RadMultiPage and RadTabStrip controls into RadAjaxManager settings.

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