日期:2014-05-17  浏览次数:20518 次

Response.Write()带参数的时候怎样跳转页面???
我想要跳转到的页面为:http://localhost:22222/CP_SBOAR/WebOrderV2.aspx

其中,22222是随机分配的端口号
此时,CP_SBOAR/WebOrderV2这个我是动态获取的,获取方法:

 string url = HttpContext.Current.Request.Url.AbsolutePath;

 那么我想让其跳转,则:
 Response.Write(string.Format("<Script language=javascript>window.location.Href={0}</Script>", url));

请问怎样改正?

之前用Response.Redirect("~" + url, false);是完全没问题的,完全可以跳转的,但是用Response.Write()就不行了,这里又必须要用Response.Write()的理由,所以请指教怎样用Response.Write()实现跳转?

------解决方案--------------------
Response.Write(string.Format("<script language=javascript>window.location.href='{0}';</script>", url));
这么呢