https://stackoverflow.com/questions/9720143/asp-net-web-application-message-box

 

Or create a method like this in your solution:

public static class MessageBox {
    public static void Show(this Page Page, String Message) {
       Page.ClientScript.RegisterStartupScript(
          Page.GetType(),
          "MessageBox",
          "<script language='javascript'>alert('" + Message + "');</script>"
       );
    }
}

Then you can use it like:

MessageBox.Show("Here is my message");

 

public static void PageAlert(Page objPage, string strContent)
{
objPage.ClientScript.RegisterClientScriptBlock(objPage.GetType(), "alert", "<script type='text/javascript'>window.alert('" + strContent + "');</script>");
}

 

相关文章:

  • 2021-11-17
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2021-12-29
  • 2021-05-15
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案