connectseekers.com

Monday, 15 December 2014

Dragable ModalPopupExtender In Asp.Net Using AjaxControlToolkit

12/15/2014 - By Pranav Singh 0

This article will show you how you can create a drag able modalpopupextender in asp.net using ajaxcontroltoolkit.  In this we will open the popup message box and drag it on screen by selecting it’s header.


So for this article first we will create a new asp.net application and add the below code in you .aspx page.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>

<%@ 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>Dragable ModalPopupExtender In Asp.Net Using AjaxControlToolkit</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnShowMessage"
            PopupControlID="divMessage" CancelControlID="btnClose" PopupDragHandleControlID="divheader">
        </asp:ModalPopupExtender>
        <table width="100%">
            <tr>
                <td>
                    <asp:Button ID="btnShowMessage" runat="server" Text="Open Popup" />
                </td>
            </tr>
        </table>
        <div runat="server" style="width: 300px;" id="divMessage">
            <table width="300px" border="1">
                <tr>
                    <td>
                        <div style="background-color: Gray; height: 20px; font-weight: bold;" id="divheader">
                            Message</div>
                        <div style="height: 100px;">
                            This is a test message.</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnClose" runat="server" Text="Close" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>

In above code please check the ModalPopupExtender properties

1.       TargetControlI : This is defined for the control id to open the popup when user click on the control.
2.       PopupControlID : This  the is the property which will open the popup.
3.       CancelControlID : This is for closing the popup
4.       PopupDragHandleControlID : In this we will define the control id by using that control we will drage the popup. 

So we have done run the application and check the output.



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