Thursday, 25 September 2014

How To show POP-Up Dialog Box By Using Jquery On Button Click

Today I will expalian how to POP-Up a dialogbox or modal POP-Up window box on a button click by usign Jquery.Simple jquery modal popup window or  jquery modal dialog is used to show alerts messages, notifications, errors and many more.
 Html Code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript">
    $(function () {
        $('#<%=btnclick.ClientID%>').click(function () {
       $("#mydemo").dialog({
            title: "Welcome To Ashok Demo!!!",         
            width: 400,
           height: 120,
            modal: true,
            buttons: {
                //Close: function () {
                //    $(this).dialog('close');
              //}
            }
        });
        return false;
    });
})
</script>
</head>
<body>
    <form id="form1" runat="server">
   <div>
<div id="mydemo" title="Basic modal dialog" style="display: none; background-color:rgb(107,108,108);"  >
<b style="color:#9FFF40"> You Have Successfully Submit!!!!!!</b>
</div>
<table align="center" style="margin-top:200px">
<tr>
<td>
<asp:Button ID="btnclick" runat="server" Text="Submit" />
</td>
</tr>
</table>
       <div style="background-color: #9FFF40"></div>
</div>
    </form>
</body>

0 comments::

Post a Comment

Copyright © DotNet-Ashok