Ajax Modal Popup In Asp.net
05:06
Here i am explaining how to use ajax modal pop up extender in asp.net.
1.Create asp.net empty website and then add one webform to the web site.
2.then write the below code in .aspx page.
1.Create asp.net empty website and then add one webform to the web site.
2.then write the below code in .aspx page.
<head runat="server">
<title>Ajax Modal
Popup Sample</title>
<style type="text/css">
.popup
{
position:
fixed;
z-index:
100;
top:
0px;
left:
0px;
background-color:
#000;
filter:
alpha(opacity=60);
-moz-opacity:
0.6;
opacity:
0.6;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:LinkButton ID="lbtnsignup" runat="server" Text="SignUp"></asp:LinkButton>
</div>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="lbtnsignup"
PopupControlID="pnlmodal" BackgroundCssClass="popup" CancelControlID="lbtnclose">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlmodal" runat="server" Style="display: none; width:50%;">
<div style="background-color: Gray;">
<asp:LinkButton ID="lbtnclose" runat="server" Style="float: right; padding-right: 10px;
text-decoration: none;">x</asp:LinkButton>
<br />
<table align="center">
<tr>
<td colspan="2">
Registration Form
</td>
</tr>
<tr>
<td>
Name:
</td>
<td>
<asp:TextBox ID="txtname" runat="server">
</asp:TextBox>
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<asp:TextBox ID="txtpwd" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Confirm Password:
</td>
<td>
<asp:TextBox ID="txtconpwd" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Mobile No:
</td>
<td>
<asp:TextBox ID="txtmno" runat="server" MaxLength="10"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Email Id:
</td>
<td>
<asp:TextBox ID="txtemailid" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Location:
</td>
<td>
<asp:TextBox ID="txtlocation" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnsubmit" runat="server" Text="Submit" />
<asp:Button ID="btncancel" runat="server" Text="Cancel" />
</td>
</tr>
</table>
</div>
</asp:Panel>
</form>
</body>
3. then run the page and see what was happining thats it simple...
really nice sir ...
ReplyDeleteyou can try another example of it here this is also very helpful...
http://www.alltechmantra.com/2013/12/how-to-use-pop-up-control-in-asp.net.html