.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Modal pop up extender in ASP.NET

Posted By:Ashutosh Jha       Posted Date: April 28, 2014    Points: 200    Category: ASP.NET    URL: http://www.dotnetspark.com  

Here i will explain how to show modal pop up in asp.net with the help of AJAX controls.
 

Please use the below code. Here i have used the page name as test.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<%@ 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></title>

    <style>

        .modalBackground

        {

            position: absolute;

            top: 0px;

            left: 0px;

            filter: alpha(opacity=60);

            -moz-opacity: 0.6;

            opacity: 0.6;

        }

        .popup

        {

            background-color: #ddd;

            margin: 0px auto;

            width: 330px;

            position: relative;

            border: Gray 2px inset;

        }

    </style>

</head>

<body>

    <form id="form1" runat="server">

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

    </asp:ToolkitScriptManager>

    <div>

     <asp:Panel ID="pnModelPopup" runat="server" CssClass="popup">

            <table>

                <tr>

                    <td>

                        User Name:

                    </td>

                    <td>

                        <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>

                    </td>

                </tr>

                <tr>

                    <td>

                        Password:

                    </td>

                    <td>

                        <asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>

                    </td>

                </tr>

                <tr>

                    <td>

                   <asp:Button ID="btnSignin" runat="server" Text="Sign in"                                     Style="margin-left: 100px"

                     />

                    </td>

                    <td>

                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" />

                    </td>

                </tr>

            </table>

        </asp:Panel>

        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"                                PopupControlID="pnModelPopup"                                             

            TargetControlID="lnkbtnSignin" DropShadow="true"                                            BackgroundCssClass="modalBackground"

            CancelControlID="btnCancel" PopupDragHandleControlID="pnModelPopup"                       OnOkScript="onOk()">

        </asp:ModalPopupExtender>

        <div style="margin-left: 300px">

            <asp:LinkButton ID="lnkbtnSignin" runat="server">Sign in</asp:LinkButton>

        </div>

    </div>

    </form>

</body>

</html>


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend