Use of the ContentUrl setting in pageview

2 posts, 0 answers
  1. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 11 Mar 2014 Link to this post

    I have defined an area on a page where I overlay other ASPX pages based on selection from a RadPanelBar. I update the ContentUrl setting in server-side code (VB) and this works well. The value is updated via Ajax.

    I am wondering whether there is a cleaner way to achieve this same effect, as there is no associated TabStrip control, nor are there "multi" pages, just the one that defines the overlay zone.

    Per the following example, I have shown the default content, and this is what gets updated.
         <div style="padding: 0px; margin: 0px; overflow: hidden; position: relative;">
             <telerik:RadMultiPage ID="RadMultiPage_About" runat="server" SelectedIndex="0">
             <telerik:RadPageView ID="RadPageView_About" runat="server" ContentUrl="minimal_about.aspx"  Height="460" Width="900">RadPageView</telerik:RadPageView>
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Mar 2014 in reply to Tomica Link to this post

    Hi Tomica,

    Please have a look into the sample code snippet to achieve your scenario.

    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" OnItemClick="RadPanelBar1_ItemClick">
            <telerik:RadPanelItem Text="Home">
            <telerik:RadPanelItem Text="About">
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
                <telerik:RadPageView ID="RadPageView1" runat="server">

    Protected Sub RadPanelBar1_ItemClick(sender As Object, e As Telerik.Web.UI.RadPanelBarEventArgs)
        Dim contenturl As String = String.Empty
        If e.Item.Text = "Home" Then
            contenturl = "Default.aspx"
            contenturl = "Default2.aspx"
        End If
        Dim multipage As RadMultiPage = DirectCast(RadPanelBar1.Items(e.Item.Index).FindControl("RadMultiPage1"), RadMultiPage)
        Dim pageview As RadPageView = multipage.FindPageViewByID("RadPageView1")
        pageview.ContentUrl = contenturl
    End Sub

Back to Top