ModalPopupExtender OK Button click event not firing? ModalPopupExtender OK Button click event not firing? asp.net asp.net

ModalPopupExtender OK Button click event not firing?


Aspx

<ajax:ModalPopupExtender runat="server" ID="modalPop"             PopupControlID="pnlpopup"             TargetControlID="btnGo"              BackgroundCssClass="modalBackground"             DropShadow="true"             CancelControlID="btnCancel" X="470" Y="300"   />//Codebehind    protected void OkButton_Clicked(object sender, EventArgs e)    {        modalPop.Hide();        //Do something in codebehind    }

And don't set the OK button as OkControlID.


It appears that a button that is used as the OK or CANCEL button for a ModalPopupExtender cannot have a click event. I tested this out by removing the

OkControlID="ModalOKButton"

from the ModalPopupExtender tag, and the button click fires. I'll need to figure out another way to send the data to the server.


It could also be that the button needs to have CausesValidation="false". That worked for me.