c# - Using onCheckedChanged with PopupControlExtender and want to prevent popup when unchecking -


I'm still quite new on this and I've tried to find the answer, so hopefully I repeat it I'm not.

I am using asp.net and there is a checkbox control that changes the popup box using the on-checked method, this popup box contains some information and 'close' Button that successfully closes the popup.

What do I need, if the checkbox is being unchecked, stop the popup. I have currently changed to matrix, which calls a code behind the method, if the control is not checked, but the popup appears before it closes quickly. How can I prevent it?

This is the proper page code:

    

... and my code is behind this method:

  protected zeros chkDDMandateChanged (Object Sender, EventArgs e) {// Cancel panel if unchecked If ((chkDDMandate.Checked) & amp;! & Amp; chkDDMandate_PopupControlExtender.Enabled) {chkDDMandate_PopupControlExtender.Cancel ();   

= "text">

AutoPostBack = "true" Remove from the chkDDMandate checkbox and add the script below after the ScriptManager control:

  & lt; Script type = "text / javascript" & gt; Function Pageload () {var extender = $ ("& lt;% = chkDDMandate_PopupControlExtender.ClientID%>"); (OnPopupShowing) extender.remove_showing; (OnPopupShowing) extender.add_showing; } On displaying popups on function (sender, args) {var checkbox checked = $ mill ("& lt;% = chkDDMandate.ClientID%>") Checked; Args.set_cancel (checkBoxChecked!); } & Lt; / Script & gt;    

Comments