asp.net 如何在点web按钮时弹出一个信息框?
展开全部
public static class MessageBox
{
public static void Show(System.Web.UI.Page page, string key, string message)
{
StringBuilder javascript = new StringBuilder();
javascript.AppendLine("<script type=\"text/javascript\">");
javascript.AppendFormat("alert('{0}');", message);
javascript.AppendLine("</script>");
page.ClientScript.RegisterStartupScript(page.GetType(), key, javascript.ToString());
}
}
{
public static void Show(System.Web.UI.Page page, string key, string message)
{
StringBuilder javascript = new StringBuilder();
javascript.AppendLine("<script type=\"text/javascript\">");
javascript.AppendFormat("alert('{0}');", message);
javascript.AppendLine("</script>");
page.ClientScript.RegisterStartupScript(page.GetType(), key, javascript.ToString());
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询