Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. IO;
Using System. Text;
Using System. Web. UI;
Namespace WebApplication
{
/// <Summary>
/// Message class
///
///
/// </Summary>
Public class Message
{
/// <Summary>
/// Message method displayed on the master content page -- UpdatePanel is used on the master page.
/// </Summary>
/// <Param name = "page"> the current information page is displayed. this </param>
/// <Param name = "updatepanel"> UpdatePanel ID </param>
/// <Param name = "messgaeInfo"> information content </param>
Public static void Show (System. Web. UI. Page page, System. Web. UI. UpdatePanel updatepanel, string messgaeInfo)
{
ScriptManager. RegisterClientScriptBlock (updatepanel, page. GetType (), "click", "alert ('" + messgaeInfo + "')", true );
}
/// <Summary>
/// The UpdatePanel message method is not used (the parent page is displayed as is and cannot be used to pop up the page because the pop-up page is closed)
/// </Summary>
/// <Param name = "page"> the current information page is displayed. this </param>
/// <Param name = "messgaeInfo"> information content </param>
Public static void Show (System. Web. UI. Page page, string messgaeInfo)
{
Page. clientScript. registerStartupScript (page. getType (), "aaaa", "<script language = javascript> alert ('" + messgaeInfo + "'); window. close (); </script> ");
}
/// <Summary>
/// The UpdatePanel message method is not used (the parent page is displayed as is and cannot be used to pop up the page because the pop-up page is closed)
/// </Summary>
/// <Param name = "page"> the current information page is displayed. this </param>
/// <Param name = "messgaeInfo"> information content </param>
Public static void ShowNoClose (System. Web. UI. Page page, string messgaeInfo)
{
Page. clientScript. registerStartupScript (page. getType (), "aaaa", "<script language = javascript> alert ('" + messgaeInfo + "'); </script> ");
}
/// <Summary>
/// The UpdatePanel message method is not used (the parent page is displayed as is, and the page is displayed)
/// </Summary>
/// <Param name = "page"> the current information page is displayed. this </param>
/// <Param name = "messgaeInfo"> information content </param>
/// <Param name = "temp"> random </param>
Public static void Show (System. Web. UI. Page page, string messgaeInfo, string temp)
{
Page. clientScript. registerStartupScript (page. getType (), "aaaa", "<script language = javascript> alert ('" + messgaeInfo + "'); </script> ");
}
/// <Summary>
/// The UpdatePanel message method is not used (the parent page is blank)
/// </Summary>
/// <Param name = "messgaeInfo"> information content </param>
Public static void Show (string messgaeInfo)
{
System. Web. HttpContext. Current. Response. Write ("<script> window. alert ('" + messgaeInfo + "') </script> ");
}
}
}