Placed on the form tabcontainer , in which he created the tabpanel , and set him visible=false . In one of them I placed the checkbox "s. I tried to make sure that when you click on the checkbox visibility of this tabpanel becomes true , but through the checkedchange event the visibility does not change.

 public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { if (CheckBox1.Checked==true) { Second.Visible = true; } } } 

How can this be implemented on an asp.net web form?

 <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <div align="center"> <ajaxToolkit:TabContainer runat="server" Height="150px" Width="205px"> <ajaxToolkit:TabPanel ID="first" runat="server" HeaderText="Signature and Bio" > <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Panel ID="Panel1" runat="server"> <asp:CheckBox ID="CheckBox1" runat="server" Text="1C" /><br> <asp:CheckBox ID="CheckBox2" runat="server" Text="Axapta"/> </asp:Panel> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="Second" runat="server" HeaderText="Second" Visible="False"> <ContentTemplate> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </div> </form> 

    1 answer 1

    You, apparently, use the usual checkbox . In order for its events to work, you must set AutoPostBack=true .

    Example markup:

     <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" /> 
    • I understand, thank you - lcnw