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

Accessing tabstrip from different page

1 Answer 98 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 22 Apr 2016, 12:20 PM

Hi,

I am using a web application, which does not have a master page. I have a header.ascx page, in which I have declared TabStrip. The tabstrip is displaying fine, but on selecting a page, the tab header color is not getting changed and also not showing sub tabs.

I used the below code:

Header.ascx:

<telerik:RadTabStrip ID="MyTab1" CausesValidation="false" SelectedIndex="0" runat="server"
                Skin="Forest" EnableEmbeddedSkins="false" >
                <Tabs>
                    <telerik:RadTab runat="server" Text="Home" NavigateUrl="~/abc.aspx">
                    </telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>

In abc.aspx, I have referenced the header.ascx page, and I am trying to use the radtab as below in cs code:

RadTabStrip menuStrip = (RadTabStrip).FindControl("RadTab");
          menuStrip.FindTabByValue("abc").Selected = true;

How to refer the tab strip in subsequent pages?

Thanks

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 27 Apr 2016, 08:36 AM
Hello Venkatesh,

If I understand your scenario correctly, you have the TabStrip in Header.ascx, you click on Tab "Home", abc.aspx is loaded and you are trying to access the TabStrip in Header.ascx. If that is the case you would not be able to access the TabStrip, because when navigating away from a page, in your case through clicking a Tab with NavigateUrl property set, the current page will unload and the new page will be loaded. These two pages have different and independent lifecycles.

Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TabStrip
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or