Steve Staple
Steve Staple

Reputation: 3279

Triggering AjaxControlToolkit ModalPopupExtender Cancel Control

My ModalPopupExtender has:

    CancelControlID="btnClose"

    <asp:Button ID="btnClose" runat="server" Text="Close" Width="50px"  />

btnClose can not have an OnClick event. System simply does not work if it does.

My popup form has 3 other buttons, Save. Delete and Cancel.

If any of these are used, the Wizard Next button and the Sidebar Links no longer work. They only work if btnClose is used. I assume it does something to tell the system the popup is closed. How do I make my Save / Delete / Cancel buttons do the same thing? cam I trigger a btnClose.Click?

Upvotes: 0

Views: 1486

Answers (1)

Sunil Gudivada
Sunil Gudivada

Reputation: 184

you can close ModelPopupExtender from code behind as well as from java script based up on your requirements.

C#:

ModalPopupExtender1.Hide();

Javascript:

$find('ModalPopupExtender1').hide(); //keep this in a function an call the same function where ever you want

Upvotes: 1

Related Questions