|
■No14550 (カシミヤ さん) に返信
[aspx]
<form id="form1" runat="server">
<div>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True"
oncheckedchanged="CheckBox1_CheckedChanged" />
<asp:CheckBox ID="CheckBox2" runat="server" />
<asp:CheckBox ID="CheckBox3" runat="server" />
<br />
<asp:Panel ID="Panel1" runat="server" Visible="False">
<asp:CheckBox ID="CheckBox4" runat="server" />
<asp:CheckBox ID="CheckBox5" runat="server" />
<asp:CheckBox ID="CheckBox6" runat="server" />
</asp:Panel>
</div>
</form>
[aspx.cs]
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
Panel1.Visible = (CheckBox1.Checked) ? true : false;
}
}
Page_loadのコードでCheckBox1.Checkedにfalseを入れていたりしませんか。
|