I have a big problem with the CheckListBox control:
if I disable it and the I enable it I loose
selection (checking) , why?
There is a way to solve this?
Tanks
M
Here some code:
<%@ Page Language="C#" %>
<script runat="server">
void Button1_Click(object sender, EventArgs e) {
CheckBoxList1.Enabled= false;
}
void Button2_Click(object sender, EventArgs e) {
CheckBoxList1.Enabled= true;
}
void Page_Load(object sender, EventArgs e) {
if (!IsPostBack)
{
CheckBoxList1.Items.Add ("1");
CheckBoxList1.Items.Add ("2");
CheckBoxList1.Items.Add ("3");
}
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:CheckBoxList id="CheckBoxList1"
runat="server"></asp:CheckBoxList>
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Disable"></asp:Button>
</p>
<p>
<asp:Button id="Button2" onclick="Button2_Click" runat="server"
Text="Enable"></asp:Button>
</p>
</form>
</body>
</html>