AJAX pop-up window message class

Source: Internet
Author: User

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> ");
}

}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.