Wednesday, March 21, 2012

urgent: Modal popup Extender is not closing after validation fires

I have an edit modalpopupextender inside the gridview that appear when linkbutton is clicked all of this inside an update panel and its working great.

when the modalpopupextender popsup i have two buttons "Close" and "Save" button and when the user click on "Close" it closes the modalpopupextender - again its working great.

but the problem isthat, when i click on "Save" button it FIRES validation and in the modalpoupextender i have twocustomvalidation controlsthat validates whether the user have check at least one checkbox or not so when the user hit on "Save" button the validation fires whic is great so far butwhen i clik on "Close" button its not closing my modalpopuextender ?

here is my close button looks like:

<ajaxToolkit:ModalPopupExtender ID="mpePerson" runat="server" TargetControlID="btnHiddenPerson"
PopupControlID="pnlPerson" OkControlID="bModalDialogCancel"CancelControlID="bModalDialogCancel" BackgroundCssClass="modalBackground"
PopupDragHandleControlID="PersonCaption">
</ajaxToolkit:ModalPopupExtender>

<asp:ButtonCausesValidation="false"ID="bModalDialogCancel" runat="server"Text=" Close "ToolTip="Close this window"/>

what is going on here?

You have your OkControlID and your CancelControlID both pointing to the same button ('bModalDialogCancel').

------------------
When you ask a question, remember to click "mark as answered" when you get a reply which answers your question.


i fixed myself, i was passing the wrong id.

thanks.

No comments:

Post a Comment