connectseekers.com

Wednesday, 25 June 2014

Example of Ajax Control Toolkit ModalPopupExtender In Asp.Net

6/25/2014 - By Pranav Singh 0

In this article I will show you how you can use Ajax ControlToolkit ModalPopupExtender control in your asp.net application on asp.net button click event.


So for this article first we will create a new asp.net application add the below add the below code in your page as shown below.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModulatPopupEctender.aspx.cs" Inherits="ProjectDemo_Asp.et.ModulatPopupEctender" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Example of Ajax Control Toolkit ModalPopupExtender In Asp.Net</title>
    <style type="text/css">
    .modalpopupbackground
    {
        background-color: #666699;
        filter: alpha(opacity=45);
        opacity: 0.7;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Button runat="server" text="Click To Open Popup"  ID="Button1"/>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="divpopup" TargetControlID="Button1" CancelControlID="Button2" BackgroundCssClass="modalpopupbackground">
        </asp:ModalPopupExtender>
    </div>
    <asp:panel runat="server" id="divpopup" style="font-size:15;background-color:green;border:5 solid yellow;width:380px;height:150px;color:White;text-align:center;">
   <h2> &nbsp;Example of Ajax Control Toolkit ModalPopupExtender In Asp.Net</h2>
   <div style="text-align:center;">
       <asp:Button ID="Button2" runat="server" Text="Close" /></div>
    </asp:panel>
   
    </form>
</body>

</html>

Here is the propertied detail of a modular popup extender.

TargetControlID - The ID of the control that activates the modal popup
PopupControlID - The ID of the control to display as a modal popup
BackgroundCssClass - The CSS class to apply to the background when the modal popup is displayed on screen
DropShadow – Set True to automatically add a drop-shadow to the modal popup
OkControlID - The ID of the control that dismisses the modal popup
OnOkScript - Script to run when the modal popup is dismissed with the OkControlID
CancelControlID - The ID of the control that cancels the modal popup
OnCancelScript - Script to run when the modal popup is dismissed with the CancelControlID
PopupDragHandleControlID - The ID of the embedded control that contains the popup header/title which will be used as a drag handle
X - The X coordinates of the top/left corner of the modal popup (the popup will be centered horizontally if not specified)
Y - The Y coordinates 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.


DOWNLOAD

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top