Getting tabstrip text on page load

2 posts, 0 answers
  1. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 28 May 2016 Link to this post


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


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

  2. Ivan Danchev
    Ivan Danchev avatar
    1628 posts

    Posted 03 Jun 2016 Link to this post


    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.

    Ivan Danchev
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top