Getting tabstrip text on page load

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

    Posted 28 May Link to this post

    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;
           
                    }
                }

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    835 posts

    Posted 03 Jun Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top