-->

Wednesday, September 2, 2015

Example of simple modal Popup window in JQuery

Example of simple modal Popup window in JQuery

Introduction 
In this article i will show you how to show a dialog box when we click on button. I will show you a example of modal window using JQuery in ASP.NET. You can use this concept in every language.

Description

In previous article i explained Textbox takes only numeric value,  Example of Text ZoomIn and ZoomOut in Jquery.

Code of modal window

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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.js" ></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" ></script>
    <script>

        $(function () {
            $('#buttonclick').click(function () {

                $('#popup').dialog({
                    title: "JQuery popup model",
                    width: 450,
                    height: 250,
                    modal: true,
                    button: {
                        close: function () {
                            $(this).dialog('close');

                        }
                    }

                });
            });


        })


    </script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div id="popup" title="Model PopUp" style="display:none">
        <b>Welcome to dotprogramming.blogspot.com</b>

    </div>
        <input type="button" id="buttonclick" value="Show Model" />
    </div>
    </form>
</body>
</html>
Code generate the following output



Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved