Firstly we need to add CSS classes.
.modalBackground
{
background-color:#CCCCFF;
filter:alpha(opacity=40);
opacity:0.5;
}
.modalWindow
{
border: solid1px#c0c0c0;
background:#f0f0f0;
padding: 0px10px10px10px;
position:absolute;
top:-1000px;
}
After that Write the following code behind the aspx page.
<ajaxToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server"
TargetControlID="lnkPopup"
PopupControlID="panEdit"
BackgroundCssClass="modalBackground"
CancelControlID="btnCancel"
PopupDragHandleControlID="panEdit">
</ajaxToolkit:ModalPopupExtender>
<asp:PanelID="panEdit"runat="server"Height="180px"Width="400px"CssClass="modalWindow">
<table width="100%">
<tr>
<td>
User Name:
</td>
<td>
<asp:TextBox ID="txtusername" runat="server"></asp:TextBox>
</td>
</tr>
</table>
<br />
<asp:Button ID="Button1" runat="server" Text="Update"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</asp:Panel>
welcome to the blogging world missi!!! :D hope you will continue this effort. keep it up... all the best!!! ;)
ReplyDeleteThanks jamil..:)
ReplyDeleteThis is a nice effort, I was looking for Modal Popup Extender. Your blog is very helpful for fresh developers.
ReplyDeleteThanks.