1 /// <summary>
2 /// 显示消息提示对话框,并进行页面跳转
3 /// </summary>
4 /// <param name="page">当前页面指针,一般为this</param>
5 /// <param name="msg">提示信息</param>
6 /// <param name="url">跳转的目标URL</param>
7 public static void ShowAndRedirect(System.Web.UI.Page page,string msg,string url)
8 {
9 StringBuilder Builder=new StringBuilder();
10 Builder.Append("<script language='javascript' defer>");
11 Builder.AppendFormat("alert('{0}');",msg);
12 Builder.AppendFormat("top.location.href='{0}'",url);
13 Builder.Append("</script>");
14 //page.RegisterStartupScript("message", Builder.ToString());
15 page.ClientScript.RegisterStartupScript(page.GetType(), "message", Builder.ToString());
16 }
17
18
2 /// 显示消息提示对话框,并进行页面跳转
3 /// </summary>
4 /// <param name="page">当前页面指针,一般为this</param>
5 /// <param name="msg">提示信息</param>
6 /// <param name="url">跳转的目标URL</param>
7 public static void ShowAndRedirect(System.Web.UI.Page page,string msg,string url)
8 {
9 StringBuilder Builder=new StringBuilder();
10 Builder.Append("<script language='javascript' defer>");
11 Builder.AppendFormat("alert('{0}');",msg);
12 Builder.AppendFormat("top.location.href='{0}'",url);
13 Builder.Append("</script>");
14 //page.RegisterStartupScript("message", Builder.ToString());
15 page.ClientScript.RegisterStartupScript(page.GetType(), "message", Builder.ToString());
16 }
17
18