2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 一例ASP.net 网站‘此网页包含重定向循环’解决方法

一例ASP.net 网站‘此网页包含重定向循环’解决方法

时间:2020-05-22 19:01:40

相关推荐

一例ASP.net 网站‘此网页包含重定向循环’解决方法

今天遇到一个奇怪问题;

某网站,使用VS自带的 Development server启动没有问题。但是用IIS Express启动以后无法访问。

使用IE查看网站查不出什么问题,使用chrome报告错误‘此网页包含重定向循环’。

看来是代码什么地方弄错了,查查代码,登录页面有这样一段;

protected void Page_Load(object sender, EventArgs e){FormsAuthentication.SignOut();string tttt = Request.QueryString["ReturnUrl"];if (tttt != "/luozhuang/Default.aspx"){Response.Redirect("../Default.aspx", true);}

看来问题出在访问路径被写死了。因为IIS Express默认使用的根是/,而 Development server设置的根是/luozhuang。

解决方法就是在IIS Express进行设置;

</site><site name="bsim" id="2048214810"><application path="/" applicationPool="Clr2IntegratedAppPool"><virtualDirectory path="/" physicalPath="E:\luozhuang" /></application><application path="/luozhuang" applicationPool="Clr2IntegratedAppPool"><virtualDirectory path="/" physicalPath="E:\luozhuang" /></application><bindings><binding protocol="http" bindingInformation="*:15792:localhost" /></bindings></site>

然后使用http://localhost:15792/luozhuang 去访问就好了,哎这些程序猿也是让人无语了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。