62,268
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 弹出JavaScript小窗口,并转向指定的页面
/// </summary>
/// <param name="message">弹出信息</param>
/// <param name="toURL">专转向的网页</param>
public static void AlertAndRedirect(string message, string toURL)
{
string js = "<script language=javascript>alert('{0}');window.location.replace('{1}')</script>";
HttpContext.Current.Response.Write(string.Format(js, message, toURL));
}
string Script="alert('OK!');window.location='index.aspx';";
ClientScript.RegisterClientScriptBlock(this.GetType(),Script,true);
Response.Write("<script>alert('登录失败');window.location.href='index.aspx';</script>");