C#打印JS的top页面重定向 - TopRedirect
2017-02-26 15:44:27 访问(1613) 赞(0) 踩(0)
/// <summary>
/// C#打印JS的top页面重定向 - TopRedirect
/// </summary>
/// <param name="url"></param>
public static void TopRedirect(string url)
{
if (HttpContext.Current == null || HttpContext.Current.Response == null)
throw new Exception("HttpContext.Current == null || HttpContext.Current.Response == null");
if (url == null || url.Length == 0)
throw new Exception("url == null || url.Length == 0");
string js = @"<script language=""javascript"" type=""text/javascript""> window.top.location='{0}'; </script>";
HttpContext.Current.Response.Write(string.Format(js, url));
}
标签:
C#打印JS的top页面重定向 - TopRedirect 


上一条:
下一条:
相关评论
发表评论