TabStrip page redirect and selection state

hello,

How do you retain the selection state for a TabStrip control on a master page when each item redirects to another aspx page ?

Only the default selected item shows.


2 Replies

MW Melba Winshia Syncfusion Team June 16, 2008 12:03 PM UTC

Hi Sorin,

Thank you for your interest in Syncfusion Products.

You can retain the selection state for a TabStrip control on a master page when each item redirects to another aspx page by using below code:

[Javascript]

window.onload=function()
{
//Callback to get the previous and current tab selection
CallbackPanel2.callback();
}
[c#]

protected void CallbackPanel2_CallbackRefresh(object sender, Syncfusion.Web.UI.WebControls.Shared.CancellableCallbackEventArgs e)
{
this.previousTabHidden.Value = this.CurrentTabHidden.Value;

//Get Current selection
value = Application["selectedvalue"] as string;

//Get previous selection to remove selection
value2 = Application["curentetab"] as string;

if (value != null)
{

foreach (TabStripItem item in this.TabStrip1.Items)
{
if (item.Selected == true && item.Text == value2)
{

item.Selected = false;
}

if (item.Text == value)
{

item.Selected = true;
}

}
}
}



Please refer the sample in the below link which illustrates the above:

http://www.syncfusion.com/support/user/uploads/Tools_ASP_TabSelection_1c5fbf92.zip

Please try this and let me know if this helps.

Thanks,
Melba



AD Administrator Syncfusion Team June 28, 2008 04:10 AM UTC

Thank you !!!


Loader.
Up arrow icon