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.
<!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
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