当用户单击 ASP 页面中的复选框时,我只想看到一个 Html 表(id='xx')。一旦用户取消勾选复选框,表格应该再次不可见。
<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>
...
我试过这段代码:
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
}
}
请帮我。