Display RadPageView Dynamically in RadTab

6 posts, 0 answers
  1. Sharan
    Sharan avatar
    9 posts
    Member since:
    Jul 2012

    Posted 27 Dec 2012 Link to this post

    Hi Team

    I am trying to load RadPageView Dyamically inside the RadTab but unable to do so.

    Ex: I have a treeview and RadTab on the screen. My requirement is if user selects the value in treeeview ex: Exmployee, then I need to dispaly Employee.aspx in RadTab. Similarly if user selects Department then display Department in RadTab.

    Below is my code:

    <telerik:RadTab
        runat="server"
        Value="ADM110_DepotAdminManage_Tab"
        Text="Depot"
         PageViewID="RadPageView_ADM110_DepotAdminManage" />
     
                      <telerik:RadPageView
                        ID="RadPageView_ADM110_DepotAdminManage"
                        runat="server"
                        ContentUrl="ADM110_DepotAdminManage.aspx"
                        Height="90%" >
                </telerik:RadPageView>
    In the above code, I am unable to change the ContentUrl dynamically. Please let me know is any method to change contentUrl dynamically.

    Thanks
    Sharan
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Dec 2012 Link to this post

    Hi Sharan,

    Try the following code to achieve your scenario.

    ASPX:
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
       <telerik:RadPageView
                       ID="RadPageView_ADM110_DepotAdminManage"
                       runat="server"
                       ContentUrl="~/Window/ChildPage.aspx"
                       Height="90%" >
               </telerik:RadPageView>
               .........................
    </telerik:RadMultiPage>

    C#:
    RadMultiPage1.PageViews[0].ContentUrl = "url";

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sharan
    Sharan avatar
    9 posts
    Member since:
    Jul 2012

    Posted 28 Dec 2012 Link to this post

    I'm impressed for quick reply. Its working now :)
    Thank you very much.

    Just last question, in below code you assigned the ContentUrl of PageView based on index i.e. 0 in this example.
    But Instead of index, how to refer the PageView by ID?  EX:ID="RadPageView_ADM110_DepotAdminManage"

    RadMultiPage1.PageViews[0].ContentUrl = "url";


    Sharan
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Jan 2013 Link to this post

    Hi Sharan,

    Try the following code snippet to achieve your scenario.

    C#:
    RadMultiPage1.FindPageViewByID("RadPageView_ADM110_DepotAdminManage").ContentUrl = "URL";

    Hope this helps.

    Regards,
    Princy.
  6. Divya
    Divya avatar
    12 posts
    Member since:
    Mar 2016

    Posted 23 Mar in reply to Princy Link to this post

    Ref : RadMultiPage1.FindPageViewByID("RadPageView_ADM110_DepotAdminManage").ContentUrl = "URL";

     

    Hi How can i do this same in Client Side ?

  7. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 25 Mar Link to this post

    Hello Divya,

    You can set the PageView's ContentUrl property with the set_contentUrl() client-side method:
    function pageLoad() {
        var url = "http://www.telerik.com";
        var multiPage = $find("<%=RadMultiPage1.ClientID %>");
        var pageViewDepotAM = multiPage.findPageViewByID("RadPageView_ADM110_DepotAdminManage");
        pageViewDepotAM.set_contentUrl(url);
    }

    This and other methods of the RadPageView object are listed in the following documentation article.

    Regards,
    Ivan Danchev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017