ModalPopupExtender use with ConfirmWindowExtender to show the confimation. The main key properties are:

  • TargetControlID
  • CancelControlID
  • OkControlID
  • PopupControlID

How we implement the ModalPopupExtender 

Step1: we use the following control on aspx page


<%--Using ScriptManager or ToolkitScriptManager according toolkit version--%>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<%--Using ModalPopupExtender and set the properties--%>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" CancelControlID ="btnCancel" OkControlID="btnOK" PopupControlID="Panel1">
<%--adding on button--%>
<asp:Button ID="Button1" runat="server" Text="Submit Page" />
<br />
<%--add the panel and two button--%>
<asp:Panel ID="Panel1" runat="server" Style="display: none; background-color: White; width: 200; border-color: Black; border-style: solid; padding: 20px;">
are you sure submit the page?<br />
<asp:Button ID="btnOK" runat="server" Text="OK" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />

Step3: Run the project

 Click on submit button 

AJAX Control Toolkit: ModalPopupExtender

  Modified On Nov-29-2017 11:27:21 PM

Leave Comment