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

Server.Transfer()无法跳转,Response.Redirect()成功跳转,为啥?
本帖最后由 gunziyang 于 2013-10-18 15:21:07 编辑
同一目录下两个网页,D.aspx和S.aspx,现在要从S.aspx跳转到D.aspx,而且需要携带查询字符串location,是汉字:
在使用Server.Transfer("D.aspx?location="+Server.UrlEncode(location))页面没有跳转,但是Debug的时候,确实进入到了D.aspx的Page_Load事件中
在使用Response.Redirect("D.aspx?location="+Server.UrlEncode(location))页面跳转成功

请问这是为什么呢,如果非要使用Server.Redirect(),应该怎么做?谢谢啦
页面跳转?查询字符串

------解决方案--------------------
用了ASP.NET AJAX?
No, you cannot call Server.Transfer on an ASP.NET AJAX enabled page
http://msmvps.com/blogs/luisabreu/archive/2007/10/10/no-you-cannot-call-server-transfer-on-an-asp-net-ajax-enabled-page.aspx
  
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/