Redirect from TabStrip

9 posts, 0 answers
  1. Steve
    Steve avatar
    9 posts
    Member since:
    Jun 2011

    Posted 06 Jul 2011 Link to this post

    In server-side how can I Redirect AWAY from a RadMultiPage with RadTabStrip to a different aspx page ?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Jul 2011 Link to this post

    Hello Steve,

    You can directly set the NavigateUrl property which cause the tab to automatically launch another Web page (specified by NavigateUrl) in the window specified by Target. If the Target property is not set, the new Web page uses the current browser window. .

    aspx:
    <Tabs>
        <telerik:RadTab runat="server" Text="Tab1" NavigateUrl="Content url.asx" Target="_blank">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Tab2">
        </telerik:RadTab>
    . . . . . . . . . .

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    9 posts
    Member since:
    Jun 2011

    Posted 07 Jul 2011 Link to this post

    Thanks, but that's not exactly the situation I have. 

    From one of the tabs I have a code-behind button click event to navigate to a different non-tabbed page on the same browser.

    Here's an example of the aspx page that defines three tabs:

        <telerik:RadTabStrip ID="RadTabStrip1" runat="server"
            MultiPageID="RadMultiPage1" SelectedIndex="0">
            <Tabs>
                <telerik:RadTab runat="server" Text="Tab 1" Owner="RadTabStrip1" Selected="True" ></telerik:RadTab>
                <telerik:RadTab runat="server" Text="Tab 2"></telerik:RadTab>
                <telerik:RadTab runat="server" Text="Tab 3"></telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Height="800px" EnableEmbeddedScripts="true">
            <telerik:RadPageView ID="RadPageViewTabDetails1" runat="server"
                ContentUrl="~/Application/TabDetails1.aspx"></telerik:RadPageView>
            <telerik:RadPageView ID="RadPageViewTabDetails2" runat="server"
                ContentUrl="~/Application/TabDetails2.aspx"></telerik:RadPageView>
            <telerik:RadPageView ID="RadPageViewTabDetails3" runat="server" 
                ContentUrl="~/Application/TabDetails3.aspx"></telerik:RadPageView>
        </telerik:RadMultiPage> 


    Then in the code-behind on one of the tabbed pages ... e.g. TabDetails3.aspx.cs  ... there is a button-click code like this:

                protected void btnNavigateElsewhere_Click(object sender, EventArgs e)
                {
                    Response.Redirect("~/Application/NonTabbedPage.aspx?reqNum=" + ReqId.ToString());
                }

    Currently the redirected page displays on the current tab replacing the old tabbed page content .. and leaving all the others tabs in the display.  I need the action to navigate away from the tabs altogether but stay in the same browser and session.

    Thanks
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 12 Jul 2011 Link to this post

    Hi Steve,

    I am not quite sure if you need to navigate away from the page with the tabs by using a tab click or by using simple button click. In case you need to use a tab click here I pasted the markup code that works just fine with me and it navigates away from the page containg the tabs when I click on Root RadTab2 tab:
    <telerik:RadTabStrip runat="server" ID="RadTabStrip1" Skin="Simple" SelectedIndex="0">
                <Tabs>
                    <telerik:RadTab runat="server" Text="Root RadTab1" SelectedIndex="0">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab2"  NavigateUrl="ComboBox.aspx">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab3">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab4">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab5">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab6">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab7">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Root RadTab8">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server"  SelectedIndex="1">
                <telerik:RadPageView ID="RadPageView1" runat="server" ContentUrl="ComboBox.aspx">
                    RadPageView</telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server" ContentUrl="ComboBoxcheckBox.aspx">
                    RadPageView2
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server" ContentUrl="ComboBoxTreeView.aspx">
                    RadPageView3
                </telerik:RadPageView>
                        </telerik:RadMultiPage>

    If, however, it refers to the other case I would suggest that you take a look at the following post.

    Regards,
    Kate
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. deepak
    deepak avatar
    3 posts
    Member since:
    Mar 2011

    Posted 12 Oct 2011 Link to this post

    hi ,
    I have the same problem as Steve.
    When i am inside a tab and then i want to redirect to some other page outside the tabbed pages, the requested page opens up as a tab.
    The exact situation is as following:
    When a user opens up a tab and then session expires. The master page redirects the user to the login page.But the login page opens as a tab and not an independant web page.
    Basically how do i navigate out of the tabbed pages on some event say a button click on the tab.


    Regards,
    Deepak


  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 17 Oct 2011 Link to this post

    Hi Deepak,

    In general when you are using the NavigateUrl property of the RadTabStrip the page that you navigate to will load in the current page. However, if you need to open the url in a new window, as I understand your scenario, you could use OnClientTabSelecting event  in a combination with our RadWindow or a simple browser popup as described in this demo.

    Regards,
    Kate
    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
  8. Geoff
    Geoff avatar
    8 posts
    Member since:
    Jan 2015

    Posted 19 Mar 2015 in reply to Kate Link to this post

    Just found this rather old post which describes my issue exactly.

    I have a page which has on it a tab strip with multi page, I would like to be able to navigate away from one of the pages in the tabs with a button click but calling a response. redirect from any of the tabs loads the new pages in that tab?

    Is there some was to do this that I have missed as it must be a common scenario.

    Geoff
  9. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 24 Mar 2015 Link to this post

    Hello Geoff,

    If you are calling Response.Redirect() on button click like this:
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://www.google.com");
    }

    You can subscribe to the button's OnClientClick and add the following in its event handler:
    function OnClientClicked(sender, eventArgs) {
        document.forms[0].target = '_blank';
    }

    <telerik:RadButton runat="server" ID="Button1" Text="Redirect" OnClientClicked="OnClientClicked" OnClick="Button1_Click" />

    This would make the browser open a new tab, instead of loading the page in the current one.

    Regards,
    Ivan Danchev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  10. Geoff
    Geoff avatar
    8 posts
    Member since:
    Jan 2015

    Posted 24 Mar 2015 in reply to Ivan Danchev Link to this post

    Thanks Ivan,

    I have sorted this now.

    Geoff
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017