Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8184029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:21:40+00:00 2026-06-07T01:21:40+00:00

I know how to hide a tab: MyTabContainerID.Tabs[1].Visible = false; That works. What I’m

  • 0

I know how to hide a tab:

MyTabContainerID.Tabs[1].Visible = false;

That works. What I’m having trouble with is changing the visibility of a tab triggered by the postback of a radioButtonList selectedIndexChanged event.

By the time the page reaches my selectedIndexChanged event handler the tab has already loaded Visible=True from the ViewState. I can change it to false all day long in my selectedIndexChanged event, it won’t hide the tab b/c it’s already loaded.

ASPX

<asp:RadioButtonList ID="rblMyRadioButtonList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rblMyRadioButtonList_SelectedIndexChanged">                                                        
<asp:ListItem Text="Yes" Value="True" Selected="True"></asp:ListItem>
<asp:ListItem Text="No" Value="False"></asp:ListItem>

ASCX

protected void Page_Init(object sender, EventArgs e)
{
    try
    {
        MyTabContainerID.Tabs[1].Visible = Tab1Visibility;
    }
    catch (Exception ex)
    {
        common.alert("Error in PageName.Page_Init.<br>ERROR=" + ex.Message);
    }
}
protected void rblMyRadioButtonList_SelectedIndexChanged(object sender, EventArgs e)
{
    try
    {       
        Tab1Visibility = Convert.ToBoolean(((RadioButtonList)sender).SelectedValue);
        MyTabContainerID.Tabs[1].Visible = Tab1Visibility;  //BY THE TIME THIS HAPPENS IT'S ALREADY ON THE PAGE WITH VISIBLE=TRUE                   
    }
    catch (Exception ex)
    {
        common.alert("Error in PageName.rblMyRadioButtonList_SelectedIndexChanged.<br>ERROR=" + ex.Message);
    }
}

protected bool Tab1Visibility
{
    get { return (bool)Session["ses_bTab1Visibility"]; }
    set { Session["ses_bTab1Visibility"] = value; }
}

Thoughts? Suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:21:41+00:00Added an answer on June 7, 2026 at 1:21 am

    Here’s what I ended up doing:

    *.ASPX

    <script type="text/javascript">
        function disableTab1() {
                $find('<%=MyTabContainer.ClientID%>').get_tabs()[1].set_enabled(false);
            }
        function enableTab1() {
            $find('<%=MyTabContainer.ClientID%>').get_tabs()[1].set_enabled(true);
        }
    </script>
    
    <!--THESE RADIOBUTTONS LEVERAGE THE TAB CONTAINER'S CLIENTSIDE set_enabled METHOD
    <asp:RadioButtonList ID="rblMyRadioButtonList" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
        <asp:ListItem Text="Yes" Value="True" Selected="True" onClick="enableTab1();"></asp:ListItem>
        <asp:ListItem Text="No" Value="False" onClick="disableTab1();"></asp:ListItem>
    </asp:RadioButtonList>
    

    *.ASCX on Page_Load

    //I RUN A SQL QUERY TO DETERMINE WHETHER OR NOT TO DISABLE TAB1 HERE 
    //IF IT SHOULD BE DISABLED I REGISTER THIS STARTUP SCRIPT
    ClientScriptManager cs = Page.ClientScript;
    Type cstype = this.GetType();
    String csScriptName = "Tab1_Visibility";
    if (!cs.IsStartupScriptRegistered(cstype, csScriptName))
    {
        cs.RegisterStartupScript(this.Page.GetType(), csScriptName, "setTimeout(function() { disableTab1()}, 0);", true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that the following code should show and hide a tiny circular progress
I am having trouble calling the right div to hide. Underneath is my code
I have a UITabbar having 5 tabs like this Now I want to hide
And just...poop, HTML gone. How do I do that? thanks. I know about .hide()
Possible Duplicate: Hide facebook app from search Okay, I know that this question was
a while ago i asked this question Jquery tabs keep tab open that is
Does anyone know why .hide(normal) does not seem to be working in jQuery 1.4.2?
I know how to hide address bar in general addEventListener(load, function() { window.scrollTo(1, 0);
Hey any body know how to hide cell contains using spreadsheet gear.
Would like to know how to hide an div after a set of css3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.