ModalPopupExtender裏面的button無法觸發server side的程式?
solution :
ModalPopupExtender & Button (or anything) Events
27 02 2007
I’m sure this it out there if I’d Google it a bit more, but I had an issue where I had the ModalPopupExtender that prompted for “OK” after setting a few options. I do not like to include script in my MasterPages and wanted to use a bit of BusinessLogic in the code-behind. So, when they Click OK, I want it the button to run it’s Button_Click event, not the OnOkScript event of the Extender.
The ModalPopupExtender control:
<cc1:ModalPopupExtender ID=”mPopPrintClassReports”runat=”server” TargetControlID=”lnkPrintClassReports”PopupControlID=”pnlOuterPrintClassReports”PopupDragHandleControlID=”pnlInnerPrintClassReports”CancelControlID=”btnCancelClassReports” Drag=”false”DropShadow=”true”></cc1:ModalPopupExtender>
Notice anything in here?
The OkControlID is not specified. Yep… that’s the entire solution. To bypass the functionality of the Extender and use the object’s own event model, simply do not link the objects. I’m sure the same works for the CancelControlID as well.
沒有留言:
張貼留言