Kevin

虫虫的痕迹!!!
  首页  :: 新随笔  :: 订阅 订阅  :: 管理

C# Web开发中弹出对话框的函数[转载]

Posted on 2010-07-17 21:52  KevinYao  阅读(8378)  评论(0编辑  收藏  举报

记得先  using

 

 

using System.Web.UI;

 

1 public void Alert(string str_Message)
2 {
3 ClientScriptManager scriptManager =((Page)System.Web.HttpContext.Current.Handler).ClientScript;
4 scriptManager.RegisterStartupScript(typeof(string), "", "alert('" + str_Message + "');", true);
5 }
6  public void Alert(string str_Message, string redirect)
7 {
8 ClientScriptManager scriptManager =((Page)System.Web.HttpContext.Current.Handler).ClientScript;
9 scriptManager.RegisterStartupScript(typeof(string), "", "alert('" + str_Message + "');self.location='"+redirect+"'", true);
10 }
11
12