Download Ajax Library and store to Bin folder under project
AjaxControlToolkit.dll
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Include style tag
<style type="text/css">
.modalPopup1
{
background-color : #87BEE1;
padding: 10px 0px 10px 0px;
padding-left: 10px;
width: 50px;
height :auto;
}
.hiddencolumn
{
display: none;
}
.simple
{
color: Red;
}
.simple:hover
{
color: #1A0006;
}
.hs
{
padding-left:5px;
}
.hs1
{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size:14px;
padding-left:5px;
padding-right:5px;
}
body
{
font-family: Arial;
font-size: 10pt;
}
.modalBackground
{
background-color: Black;
filter: alpha(opacity=40);
opacity: 0.4;
}
.modalPopup
{
background-color: #FFFFFF;
width: 400px;
border: 3px solid #666666;
}
.modalPopup .header
{
background-color: #666666;
height: 30px;
color: White;
line-height: 30px;
text-align: center;
font-weight: bold;
}
.modalPopup .body
{
min-height: 50px;
line-height: 30px;
text-align: center;
padding:5px
}
.modalPopup .footer
{
padding: 3px;
}
.modalPopup .button
{
height: 23px;
color: White;
line-height: 23px;
text-align: center;
font-weight: bold;
cursor: pointer;
background-color: #9F9F9F;
border: 1px solid #666666;
}
.lineheght
{
margin-bottom:0.8em;
width:100%;
color:#333;
}
.header-center
{
text-align:center;
}
</style>
Include Popup Script
<script type="text/javascript">
function pageLoad(sender, args) {
if (!args.get_isPartialLoad()) {
// add our handler to the document's
// keydown event
$addHandler(document, "keydown", onKeyDown);
}
}
function onKeyDown(e) {
if (e && e.keyCode == Sys.UI.Key.esc) {
// if the key pressed is the escape key, dismiss the dialog
$find('addAttribute1').hide();
//$find('editAttribute1').hide();
}
}
</script>
Coder Under Body Section
<body>
<cc1:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></cc1:ToolkitScriptManager>
//create event control
<asp:Button ID="but1" runat="server" Text="Edit" Width="220px" CommandName="but1_Click" CssClass="contact-form" />
//create dummy linkbutton control
<asp:LinkButton ID="lblfake" runat="server" Text=""></asp:LinkButton>
//create popup
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1" TargetControlID="lblfake" BackgroundCssClass="modalBackground" BehaviorID="addAttribute1">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none; Width: 600px">
Design your contani
</asp:Panel>
//Create c# Code
Panel1.Visible = true;
ModalPopupExtender1.Show();
AjaxControlToolkit.dll
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Include style tag
<style type="text/css">
.modalPopup1
{
background-color : #87BEE1;
padding: 10px 0px 10px 0px;
padding-left: 10px;
width: 50px;
height :auto;
}
.hiddencolumn
{
display: none;
}
.simple
{
color: Red;
}
.simple:hover
{
color: #1A0006;
}
.hs
{
padding-left:5px;
}
.hs1
{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size:14px;
padding-left:5px;
padding-right:5px;
}
body
{
font-family: Arial;
font-size: 10pt;
}
.modalBackground
{
background-color: Black;
filter: alpha(opacity=40);
opacity: 0.4;
}
.modalPopup
{
background-color: #FFFFFF;
width: 400px;
border: 3px solid #666666;
}
.modalPopup .header
{
background-color: #666666;
height: 30px;
color: White;
line-height: 30px;
text-align: center;
font-weight: bold;
}
.modalPopup .body
{
min-height: 50px;
line-height: 30px;
text-align: center;
padding:5px
}
.modalPopup .footer
{
padding: 3px;
}
.modalPopup .button
{
height: 23px;
color: White;
line-height: 23px;
text-align: center;
font-weight: bold;
cursor: pointer;
background-color: #9F9F9F;
border: 1px solid #666666;
}
.lineheght
{
margin-bottom:0.8em;
width:100%;
color:#333;
}
.header-center
{
text-align:center;
}
</style>
Include Popup Script
<script type="text/javascript">
function pageLoad(sender, args) {
if (!args.get_isPartialLoad()) {
// add our handler to the document's
// keydown event
$addHandler(document, "keydown", onKeyDown);
}
}
function onKeyDown(e) {
if (e && e.keyCode == Sys.UI.Key.esc) {
// if the key pressed is the escape key, dismiss the dialog
$find('addAttribute1').hide();
//$find('editAttribute1').hide();
}
}
</script>
Coder Under Body Section
<body>
<cc1:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></cc1:ToolkitScriptManager>
//create event control
<asp:Button ID="but1" runat="server" Text="Edit" Width="220px" CommandName="but1_Click" CssClass="contact-form" />
//create dummy linkbutton control
<asp:LinkButton ID="lblfake" runat="server" Text=""></asp:LinkButton>
//create popup
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1" TargetControlID="lblfake" BackgroundCssClass="modalBackground" BehaviorID="addAttribute1">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none; Width: 600px">
Design your contani
</asp:Panel>
//Create c# Code
Panel1.Visible = true;
ModalPopupExtender1.Show();
No comments:
Post a Comment