U can use ModalPopupExtender of Ajax Extension....
The script of the ModalPopupExtender is as follows:
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="hiddenTargetControlForModalPopup" runat="server" Style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="programmaticModalPopup" runat="server" BackgroundCssClass="modalBackground"
BehaviorID="programmaticModalPopupBehavior" DropShadow="True" PopupControlID="programmaticPopup"
PopupDragHandleControlID="programmaticPopupDragHandle" RepositionMode="RepositionOnWindowScroll"
TargetControlID="hiddenTargetControlForModalPopup">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="programmaticPopup" runat="server" CssClass="modalPopup" Style="display: none;
width: 350px; padding: 10px">
<asp:Panel ID="programmaticPopupDragHandle" runat="Server" Style="cursor: move; background-color: #DDDDDD;
border: solid 1px Gray; color: Black; text-align: center;">
Status
</asp:Panel>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:Label id="lblStatusMessage" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="OkButton" runat="server" OnClick="hideModalPopupViaServer_Click"
Text="OK" Width="58px" />
<br />
</asp:Panel>
Then to use the ModalPopupExtender whereever u want u can use the code below....
{
this.lblStatusMessage.Text="Message Here";
this.programmaticModalPopup.Show();
}
Note-> Dont forget to add the following code in ur code behind file to make the Messagebox disappear when the ok button is clicked..
protected void hideModalPopupViaServer_Click(object sender, EventArgs e)
{
this.programmaticModalPopup.Hide();
}