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

Radtabstrip focus on page redirection

4 Answers 175 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Lubna Ansari
Top achievements
Rank 1
Lubna Ansari asked on 21 Apr 2010, 12:29 PM

Hi,

I am using Radtabstrip in a header control which I have placed in my master page. I'm trying to redirect to the specific pages on cliking of tabs in header, which is working fine. The only problem is, the selected tab of Radtabstrip is always the first tab. It is redirecting to correct page but focus is always to tab 0 in Radtabstrip. Following is my html code.

<

 

telerik:RadTabStrip ID="RadTabStrip1" runat="server" 

 

 

 

SelectedIndex="0" CssClass="tabStrip" OnTabClick="RadTabStrip1_TabClick" CausesValidation="false">

 

 

<Tabs>

 

 

<telerik:RadTab Text="Home">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab Text="Login">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab Text="Register">

 

 

</telerik:RadTab>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

 

 


Below is my code behind

protected

 

void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)

 

 

{

 

 

string  HTMLTemplatePath =

ConfigurationSettings.AppSettings["Path"]; 

 

 

string strCurrentTab = e.Tab.Text;

 

 

switch (strCurrentTab)

{

 

 

 

case "Home":

 

RadTabStrip1.SelectedIndex=e.Tab.Index;

 

Response.Redirect(HTMLTemplatePath +

 

GeneralDeclaration.PAGE_Home);

 

 

 

 

break;

 

 

 

 

case "Login":

 

RadTabStrip1.SelectedIndex = e.Tab.Index;

 

Response.Redirect(HTMLTemplatePath +

 

GeneralDeclaration.PAGE_Login);
break;

 

 

 

case "Register":

 

RadTabStrip1.SelectedIndex = e.Tab.Index;

 

Response.Redirect(HTMLTemplatePath +

 

GeneralDeclaration.PAGE_Register); 

 

 

 

break;

 

}

}



Thanks.

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 21 Apr 2010, 12:59 PM
Hello Lubna,

It's expected as you open a new page and new tabstrip is created. You can try to find the clicked tab in Page_Load using the url of the page and set its Selected property to true.

Kind regards,
Yana
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.
0
Andrew Cao
Top achievements
Rank 1
answered on 27 May 2010, 09:29 PM
same problem here, when I create multiple levels of tapstrips on different master page, the focus is always always on the first one after I selected a tap from a lower level. and I did set the selected = ture.
0
Lubna Ansari
Top achievements
Rank 1
answered on 28 May 2010, 09:24 AM
Hi Andrew,

What I am doing is on my header control page load event i'm cheking the url and then set the tabs accordingly. Following is my code which might help you.

protected

 

void Page_Load(object sender, EventArgs e)

 

{

 

string strURL = Request.Url.Segments[2].ToString();

 

 

switch (strURL)

 

{

 

case GeneralDeclaration.PAGE_Home:

 

RadTabStrip1.SelectedIndex = 0;

 

break;

 

 

case GeneralDeclaration.PAGE_Login:

 

RadTabStrip1.SelectedIndex = 1;

 

break;

 

 

case GeneralDeclaration.PAGE_Register:

 

RadTabStrip1.SelectedIndex = 2;

 

break;

 

}

 

 

}

0
Andrew Cao
Top achievements
Rank 1
answered on 28 May 2010, 03:49 PM
thanks alot
Tags
TabStrip
Asked by
Lubna Ansari
Top achievements
Rank 1
Answers by
Yana
Telerik team
Andrew Cao
Top achievements
Rank 1
Lubna Ansari
Top achievements
Rank 1
Share this question
or