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

Display RadPageView Dynamically in RadTab

5 Answers 175 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Sharan
Top achievements
Rank 1
Sharan asked on 28 Dec 2012, 05:52 AM
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

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Dec 2012, 06:52 AM
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.
0
Sharan
Top achievements
Rank 1
answered on 28 Dec 2012, 08:54 AM
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
0
Princy
Top achievements
Rank 2
answered on 02 Jan 2013, 06:35 AM
Hi Sharan,

Try the following code snippet to achieve your scenario.

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

Hope this helps.

Regards,
Princy.
0
Divya
Top achievements
Rank 1
answered on 23 Mar 2016, 03:09 PM

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

 

Hi How can i do this same in Client Side ?

0
Ivan Danchev
Telerik team
answered on 25 Mar 2016, 01:26 PM
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.
Tags
TabStrip
Asked by
Sharan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Sharan
Top achievements
Rank 1
Divya
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or