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

Getting tabstrip text on page load

1 Answer 6 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 28 May 2016, 07:14 AM

hi

how do i get the selected tab text on page load? Thanks a lot.

 

 protected void Page_Load(object sender, EventArgs e)
            {
        
                if(!IsPostBack)
                {
                   RadTabStrip1.SelectedIndex = 0;
                   string x = RadTabStrip1.SelectedTab.Text;
       
                }
            }

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 03 Jun 2016, 03:45 PM
Hello,

On initial load you cannot access any of the tabs (the selected one including) in the Page_Load handler. At this point the control is not yet populated, so you can use the TabStrip's OnDataBound (OnDataBound="RadTabStrip1_DataBound") event instead, in which the tabs will be accessible. After the initial load on subsequent postbacks the selected tab will be accessible in the Page_Load handler.

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
L
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or