I just want to Visible a Html Table(id=’xx’) when user clicked on check-box in ASP page. And once the user untick on the check-box The Table should invisible again.
<table>
<tr>
<td colspan='2'>
<table id='xx'>
<tr>
<td colspan='2'>
Student Information :
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Select Student name :"></asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="200px">
</asp:DropDownList>
</td>
</tr>
...
I have tried this code:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
// need a way to hide the Table id='xx'
}
else {
DropDownList1.Visible = true; // This is also not working
}
}
Please help me.
You have two options here…
Option 1 Handle at Server side
Now you can access the table control like below
Option 2 Handle at Client Side
JavaScript Function