title: Hide and Display of TabPanel in TabContainer
body: <p>I'm trying to hide the <code>TabPanel4</code> when the application start, then when user select specific item from the dropdownlist it then display the <code>TabPanel4</code> out for the user. Below is the code I used, not sure why it not working. Do help me take a look at my code see which part did I do wrongly. Thanks!</p>
  
  <p>Aspx</p>
  
  <pre><code>&lt;asp:TabContainer ID="TabContainer1" runat="server" Height="75%" Width="100%" UseHorizontalStripPlacement="true"
      ActiveTabIndex="0" OnDemand="true" AutoPostBack="true" TabStripPlacement="Top" ScrollBars="Auto"&gt;
  &lt;asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Incident Information" Enabled="true" ScrollBars="Auto" OnDemandMode="Once"&gt;
  &lt;ContentTemplate&gt;
      &lt;table width="100%"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;b&gt;Type of crime:&lt;/b&gt;
              &lt;asp:DropDownList ID="ddlToC" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlToC_SelectedIndexChanged"&gt;
                  &lt;asp:ListItem&gt;Accident&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Theft&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Robbery&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Housebreaking&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Fraud&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Loan Shark&lt;/asp:ListItem&gt;
              &lt;/asp:DropDownList&gt;
              &lt;br /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/ContentTemplate&gt;
      &lt;/asp:TabPanel&gt;
  
  &lt;asp:TabPanel ID="TabPanel4" runat="server" HeaderText="Property" Enabled="true" ScrollBars="Auto" OnDemandMode="Once" Visible="false"&gt;
          &lt;ContentTemplate&gt;
              Is there any property lost in the incident?
              &lt;asp:RadioButton ID="rbPropertyYes" runat="server" GroupName="rbGroup3" Text="Yes" AutoPostBack="True" /&gt;
              &lt;asp:RadioButton ID="rbPropertyNo" runat="server" GroupName="rbGroup3" Text="No" AutoPostBack="True" /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;asp:Label ID="Label4" runat="server" Text="Describe what was lost in the incident." Visible="False"&gt;&lt;/asp:Label&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;asp:TextBox ID="txtProperty" runat="server" Height="75px" TextWrapping="Wrap" TextMode="MultiLine" Width="400px" Visible="False"/&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;asp:Label ID="Label5" runat="server" Text="You have " Visible="False"&gt;&lt;/asp:Label&gt;&lt;asp:Label ID="lblCount3" runat="server" Text="500" Visible="False"&gt;&lt;/asp:Label&gt;&amp;nbsp;&lt;asp:Label ID="Label6" runat="server" Text=" characters left." Visible="False"&gt;&lt;/asp:Label&gt;
          &lt;/ContentTemplate&gt;
  &lt;/asp:TabPanel&gt;
  &lt;/asp:TabContainer&gt;
  </code></pre>
  
  <p>Code behind</p>
  
  <pre><code>protected void ddlToC_SelectedIndexChanged(object sender, EventArgs e)
  {
      if (ddlToC.SelectedValue.Equals("Theft"))
      {
          TabPanel4.Visible = true;
      }
      else if (ddlToC.SelectedValue.Equals("Robbery"))
      {
          TabPanel4.Visible = true;
      }
      else if (ddlToC.SelectedValue.Equals("Housebreaking"))
      {
          TabPanel4.Visible = true;
      }
      else if (ddlToC.SelectedValue.Equals("Fraud"))
      {
          TabPanel4.Visible = true;
      }
  }
  </code></pre>
  
  <p>To add on: even I take away the <code>Visible="false"</code> from the aspx page and set it in code behind page under <code>Page_Load</code> it don't work, it still don't appear when I select the item in the dropdownlist. Also tried using <code>TabContainer1.Tabs[3].Visible = false / true;</code> to hide or display it but it also don't seem to work.</p>