Note that there are some explanatory texts on larger screens.

plurals
  1. POcheckbox chekced or unchecked does not trigger event
    text
    copied!<p>There is an exisiting page I am working on at where I work, and there is a checkbox in the ascx , and it has a CheckedChange event for it in its .cs The problem I am having with that page is that when i run the website and check the box, it never fires the event, instead it goes through the On_Load event and it never pass throgh the event... I am not sure why it is not firing the event...</p> <pre><code> &lt;asp:CheckBox runat="server" ID="OptionSelected" OnCheckedChanged="OptionSelected_CheckedChanged" AutoPostBack="true" /&gt;&amp;nbsp; &lt;asp:Label runat="server" ID="OptionHeader"&gt;&lt;/asp:Label&gt; protected void OptionSelected_CheckedChanged(object sender, EventArgs e) { //some code here } </code></pre> <p>PS: This is a control ascx sorry, I forgot to mention. Also another symptom is that the page where that control is... it refreshes unexpectedly, clears some data (including the checkbox if it is checked) and cant figure out what it is causing it.</p> <p>Any ideas of the reason why this might be happening? things i should look for?</p> <pre><code>public PortalInfoPortal myPortal { get { return portal.GetPortalInfo(); } } protected void Page_Load(object sender, EventArgs e) { //added this an nothing OptionSelected.CheckedChanged += new EventHandler(OptionSelected_CheckedChanged); if (myPortal != null) { lblOptionMsg.Text = "(" + myPortal.MaxOptionSelectedCharacters.ToString() + " char max)"; txtMessage.MaxLength = myPortal.MaxOptionSelectedCharacters; var maxLength = myPortal.MaxOptionSelectedCharacters; maxCheck.ValidationExpression = @"^[\s\S]{0," + maxLength.ToString() + "}$"; } //There is no binding of any type here } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload