OnClientTabSelecting sender.get_selectedTab().get_text() is incorrect

2 posts, 0 answers
  1. Gary B.
    Gary B. avatar
    11 posts
    Member since:
    Jul 2009

    Posted 23 Sep 2009 Link to this post

    My problem happens after I have added and removed a tab.
    var tabStrip = $find("<%= RadTabStrip1.ClientID %>"); 
    var selectedTab = tabStrip.findTabByText("StopOffs"); 
    if (selectedTab == null) { 
        var tab = new Telerik.Web.UI.RadTab(); 
        selectedTab = tabStrip.findTabByText("StopOffs"); 
    if (a == "YES") { 
    else { 
    So assume this code has been executed and a == "NO".
    (If a == "YES" then the tab is added and everything happens as expected.)
    The problem is after I leave the tab I need an event to fire based on the tab I leave, but OnClientTabSelecting is giving me the wrong tab name.
    function OnClientTabSelecting(sender, eventArgs) { 
        var selectedTab = sender.get_selectedTab().get_text(); 
        alert (selectedTab); 
    So, in the case described above when I leave tab "Questions" OnClientTabSelecting will alert "References".
    But, if the a == "YES", and therefore "StopOffs" is in the tabStrip and shown, then when I leave tab "Questions" OnClientTabSelecting will alert "Questions" like it is supposed to.
    Also, if I never reach the function shown in the first code block (that is "StopOffs" tab was never added) then when I leave tab "Questions" OnClientTabSelecting will also alert "Questions" like it is supposed to.
    Note: StopOffs tab is to the left of Questions tab. I don't know why it matters, but I add tabs to the right of Questions without an issue.
    Thanks for any help.
  2. Paul
    Paul avatar
    4281 posts

    Posted 24 Sep 2009 Link to this post

    Hi Gary,

    I think it will be best if you can open a support ticket and send us a simple running project (incl. your custom skin, CSS, images, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top