62,041
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 客户端弹出信息后跳转到新的url
/// </summary>
/// <param name="msg">弹出的信息</param>
/// <param name="url">需要跳转到的url</param>
public static void ClientMsg(string msg, string url)
{
if (HttpContext.Current.Handler != null)
{
System.Web.UI.Page handler = HttpContext.Current.Handler as System.Web.UI.Page;
if (handler != null)
{
handler.ClientScript.RegisterClientScriptBlock(handler.GetType(), Guid.NewGuid().ToString(), "alert('" + msg + "');window.location.href='" + url + "';", true);
}
}
}
Common.ClientMsg("请求参数错误", "/Pages/");