日期:2014-05-18 浏览次数:20384 次
/// <summary> /// 显示消息提示对话框,并进行页面跳转 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="msg">提示信息</param> /// <param name="url">跳转的目标URL</param> public static void ShowAndRedirect(System.Web.UI.Page page, string msg, string url) { StringBuilder Builder = new StringBuilder(); Builder.Append("<script language='javascript' defer>"); Builder.AppendFormat("alert('{0}');", msg); Builder.AppendFormat("location.href='{0}'", url); Builder.Append("</script>"); page.RegisterStartupScript("message", Builder.ToString()); }