Load aspx different page each tab

5 posts, 0 answers
  1. Albert
    Albert avatar
    36 posts
    Member since:
    May 2010

    Posted 09 Sep 2010 Link to this post

    In my application I have one form called [Main.aspx] :

    In this page i put one tab strip called [RadTab1] and it have following tabs :
    1.Home 
    2.Abouut Us
    3.Contact Us
    4.Feedback

    Now what I want is when user click on Home tab at that time Home.aspx will be load under corrosponding page view...

    When click on abount us then AboutUs.aspx ,similarly for other two..

    I do no want to do this with master page and user controls..every thing should be in Main.aspx.


    I have tried following code but it redirect me to another page .

    <telerik:RadTabStrip ID="radTabMain" runat="server" Width="100%" MultiPageID="RadMultiPage1"
                SelectedIndex="0">
                <Tabs>
                    <telerik:RadTab Text="Home" NavigateUrl="Home.aspx" runat="server">
                    </telerik:RadTab>
                    <telerik:RadTab Text="AbouutUs" NavigateUrl="AbouutUs.aspx" runat="server">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Contact Us" NavigateUrl="Contact.aspx" runat="server">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Feedback" NavigateUrl="Feedback.aspx" runat="server">
                    </telerik:RadTab>
                </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">
                <telerik:RadPageView  ID="RadPageView1" runat="server">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server">
                </telerik:RadPageView>
                <telerik:RadPageView runat="server" ID="RadPageView1">
                </telerik:RadPageView>
    </telerik:RadMultiPage>


    So what ot do in this case ?

    Please help me. Please send me code for this.

    -Thanks
    Albert
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 09 Sep 2010 Link to this post

    Hi Albert,

    You can use an iframe control and load the different pages through code-behind on TabClick event. Also you can save the Url for each tab in a custom attribute. Here's the code:

    ASPX:
    <telerik:RadTabStrip ID="radTabMain" runat="server" Width="100%" OnTabClick="radTabMain_TabClick">
                <Tabs>
                    <telerik:RadTab Text="Home" runat="server" Url="Home.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab Text="AboutUs" runat="server" Url="AboutUs.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Contact Us" runat="server" Url="ContactUs.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Feedback" runat="server" Url="Feedback.aspx">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <iframe id="frame1" width="100%" height="300" runat="server">
                <p>
                    Your browser does not support iframes.</p>
            </iframe>

    C#:
    protected void radTabMain_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
        {
            frame1.Attributes["src"] = e.Tab.Attributes["Url"]; 
        }

    Hope this helps.

    All the best,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Charles
    Charles avatar
    3 posts
    Member since:
    Oct 2012

    Posted 04 Oct 2012 Link to this post

    Try doing it this way..

    <telerik:RadTabStrip ID="radTabMain" runat="server" Width="100%" MultiPageID="RadMultiPage1"
                SelectedIndex="0">
                <Tabs>
                    <telerik:RadTab Text="Home" runat="server">
                    </telerik:RadTab>
                    <telerik:RadTab Text="AbouutUs" runat="server">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Contact Us" runat="server">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Feedback"  runat="server">
                    </telerik:RadTab>
                </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">
                <telerik:RadPageView  ID="RadPageView1" runat="server"  ContentUrl="Home.aspx">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server" ContentUrl="AboutUs.aspx">
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server" ContentUrl="....">
                </telerik:RadPageView>
                <telerik:RadPageView runat="server" ID="RadPageView1" ContentUrl="....">
                </telerik:RadPageView>
    </telerik:RadMultiPage>

    I had mine like that and it works.
  5. Hai Feng Ma
    Hai Feng Ma avatar
    1 posts
    Member since:
    Mar 2010

    Posted 08 Oct 2012 Link to this post

    I configured these Content Urls, but it does not work for me.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Oct 2012 Link to this post

    Hello,

    Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadTabStrip ID="radTabMain" runat="server" Width="100%" MultiPageID="RadMultiPage1" SelectedIndex="0">
      <Tabs>
         <telerik:RadTab Text="Home" runat="server" PageViewID="RadPageView1">
         </telerik:RadTab>
         <telerik:RadTab Text="AboutUs" runat="server" PageViewID="RadPageView2">
         </telerik:RadTab>
         <telerik:RadTab Text="Contact Us" runat="server" PageViewID="RadPageView3">
         </telerik:RadTab>
         <telerik:RadTab Text="Feedback" runat="server" PageViewID="RadPageView4">
         </telerik:RadTab>
      </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">
      <telerik:RadPageView ID="RadPageView1" runat="server" ContentUrl="Home.aspx" Selected="true">
      </telerik:RadPageView>
      <telerik:RadPageView ID="RadPageView2" runat="server" ContentUrl="AboutUs.aspx">
      </telerik:RadPageView>
      <telerik:RadPageView ID="RadPageView3" runat="server" ContentUrl="ContactUs.aspx">
      </telerik:RadPageView>
      <telerik:RadPageView runat="server" ID="RadPageView4" ContentUrl="FeedBack.aspx">
      </telerik:RadPageView>
    </telerik:RadMultiPage>

    Please elaborate your scenario if it doesn't helps.

    Regards,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017