ModalPopupExtender OK Button click event not firing?

后端 未结 8 1439
旧巷少年郎
旧巷少年郎 2020-12-14 00:04

I have a Button inside an UpdatePanel. The button is being used as the OK button for a ModalPopupExtender. For some reason, the button click event is not firing. Any idea

8条回答
  •  猫巷女王i
    2020-12-14 01:05

    I've found a way to validate a modalpopup without a postback.

    In the ModalPopupExtender I set the OnOkScript to a function e.g ValidateBeforePostBack(), then in the function I call Page_ClientValidate for the validation group I want, do a check and if it fails, keep the modalpopup showing. If it passes, I call __doPostBack.

    function ValidateBeforePostBack(){ 
         Page_ClientValidate('MyValidationGroupName'); 
         if (Page_IsValid) { __doPostBack('',''); } 
         else { $find('mpeBehaviourID').show(); } 
    }
    

提交回复
热议问题