Code for Ajax Modal-Popup Extender
Here add one Asp:Panel (in example
pnlADusers) on the aspx page and add your all controls in that panel.
Note: All Events of .net controls can be accessible on code behind.
<Ajax:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="TargetControlForModalPopup"
PopupControlID="pnlADusers"
BackgroundCssClass="modalBackground"
DropShadow="false"
OkControlID=""
CancelControlID=""
/>
Control on click ModalPopup will display
<asp:Button runat="server" ID="TargetControlForModalPopup" />
CSS classes
.modalPopup
{
background-color:#ecedef;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
width:600px;
font-family:"Verdana, Arial, Helvetica, sans-serif, Trebuchet MS";
font-size:13px;
font-style:normal;
}
.modalPopupExtraWidth
{
background-color:#ecedef;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
width:700px;
}
.modalBackground
{
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}
Properties Description of Model Popup
- TargetControlID - The ID of the element that activates the modal popup
- PopupControlID - The ID of the element to display as a modal popup
- BackgroundCssClass - The CSS class to apply to the background when the modal popup is displayed
- DropShadow - True to automatically add a drop-shadow to the modal popup
- OkControlID - The ID of the element that dismisses the modal popup
- OnOkScript - Script to run when the modal popup is dismissed with the OkControlID
- CancelControlID - The ID of the element that cancels the modal popup
- OnCancelScript - Script to run when the modal popup is dismissed with the CancelControlID
- PopupDragHandleControlID - The ID of the embedded element that contains the popup header/title which will be used as a drag handle
- X - The X coordinate of the top/left corner of the modal popup (the popup will be centered horizontally if not specified)
- Y - The Y coordinate of the top/left corner of the modal popup (the popup will be centered vertically if not specified)
- RepositionMode - The setting that determines if the popup needs to be repositioned when the window is resized or scrolled.