asp.net弹出对话框C#函数【以后用会很方便】

public void Alert(string str_Message)
        {
            ClientScriptManager scriptManager =((Page)System.Web.HttpContext.Current.Handler).ClientScript;
            scriptManager.RegisterStartupScript(typeof(string), "", "alert('" + str_Message + "');", true);
        }
public void Alert(string str_Message, string redirect)
        {
            ClientScriptManager scriptManager =((Page)System.Web.HttpContext.Current.Handler).ClientScript;
            scriptManager.RegisterStartupScript(typeof(string), "", "alert('" + str_Message + "');self.location='"+redirect+"'", true);
        }
posted on 2008-08-12 17:12  草原和大树  阅读(906)  评论(0编辑  收藏  举报