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

Radtabstrip Browser Back button problem

1 Answer 48 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Het
Top achievements
Rank 1
Het asked on 29 Aug 2008, 09:46 PM
Telerik Support,

I have a RadTabStrip in my page. I click and traverse on the different tabs, when I click on the browser's back button, it doesn't take me to the previous tab I had clicked.

Is there a way to handle this scenario ?

Thanks,
Het

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Sep 2008, 11:15 AM
Hi Het,

Browser history keeps only URL navigations. Changing the active tab does not modify the URL by default hence it does not work with browser history. A possible workaround would be to use the NavigateUrl property of the tab and change the current page on the server side based on an URL parameter. Here is a quick example:

<telerik:RadTabStrip runat="server" id="RadTabStrip1">
   <Tabs>
       <telerik:RadTab Text="First" NavigateUrl="Default.aspx?Tab=0" />
       <telerik:RadTab Text="First" NavigateUrl="Default.aspx?Tab=1" />
   </Tabs>
</telerik>

protected void Page_Load(object sender, EventArgs e)
{
    string tab = Request.QueryString["Tab"];
    int tabIndex = 0;
    if (!string.IsNullOrEmpty(tab))
         tabIndex = Convert.ToInt32(tab);
   RadMultiPage1.PageViews[tabIndex].Selected = true;
   RadTabStrip1.Tabs[tabIndex].Selected = true;
}

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TabStrip
Asked by
Het
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or