In the aspx page:
First add ajax toolkit and register in the aspx page as:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
then add
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager>
and then:
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<cc1:ModalPopupExtender TargetControlID="btnShowPopup" ID="pnlModal_ModalPopupExtender"
runat="server" DynamicServicePath="" Enabled="True" BackgroundCssClass="modalBackground"
PopupControlID="pnlModal" CancelControlID="btnClose" DropShadow="true">
</cc1:ModalPopupExtender>
in this button btnShowPopup with display none is used as fake button.
so that ModalPopUpExtender is called from Code Behind.
otherwise you can use it as ,without display none.
<asp:Panel ID="pnlModal" runat="server" Height="99px" Width="368px">
<table class="mainModalTable" cellpadding="0" height="98px" cellspacing="0" width="368px">
<tr>
<td class="mainModaTableTD">
<table class="mainModalInnerTable" cellspacing="0" cellpadding="0" height="98px"
width="368px">
<tr>
<td class="mainModalInnerTableTD">
<table border="0" cellspacing="0" cellpadding="4" style="width: 368px" height="98px">
<tr>
<td class="mainModalDraggablePanelTD" align="left">
<asp:Panel CssClass="mainModalDraggablePanel" ID="MPD" runat="server">
<span class="mainModalTitle" id="spanTitle">
<asp:Label ID="lblShowPopUpMsg" runat="server" Font-Size="10px" Text="" ForeColor="White"></asp:Label>
</span>
</asp:Panel>
</td>
<td align="right" class="mainModalDraggablePanelCloseTD">
<asp:ImageButton SkinID="CloseModal" runat="server" ID="clB" ImageUrl="~/Image/close.gif" />
</td>
</tr>
<tr>
<td class="mainModalContentsTD" colspan="2" align="center">
<div id="Div3">
</div>
</td>
</tr>
<tr>
<td class="mainModalContentsTD" colspan="2" align="center">
<div id="mainModalContents">
<asp:Label runat="server" ID="lblModalPopUp" Font-Bold="true" ForeColor="#3A6EA5" Text="Are you sure to update all assets at once."></asp:Label>
</div>
</td>
</tr>
<tr>
<td class="mainModalContentsTD" colspan="2">
<div id="Div1">
</div>
</td>
</tr>
<tr>
<td class="mainModalContentsTD" colspan="2" align="center">
<div id="Div2">
<asp:Button ID="btnDone" runat="server" Text="Done" OnClick="btnDone_Click" CausesValidation="false"
CssClass="asset-viewer-btn" />
<asp:Button ID="btnClose" runat="server" Text="Close" CausesValidation="false" CssClass="asset-viewer-btn" />
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
this is the panel used for the ModalPopUp extender.
You can edit it what u want to use.
in the code behind:
protected void btnSaveAllRecords_Click(object sender, EventArgs e)
{
lblShowPopUpMsg.Text = "The page at " + Request.Url.GetLeftPart(UriPartial.Authority) + " says...";
pnlModal_ModalPopupExtender.Show();
}
lblShowPopUpMsg.Text = "The page at " + Request.Url.GetLeftPart(UriPartial.Authority) + " says...";
this label gives you the left part of the url.
thats all.
you can use it in your way..
thanks