一般网站都会对未登录用户进行限制,只要对webConfig配置文件略作修改就可以了
内容如下
<System.Web>
<authentication mode="Forms">
<forms name="MarketWebAuth" loginUrl="Login.aspx" protection="None" timeout="60"/>
</authentication>
<authorization>
<deny users="?">
</authorization>
</System.Web>
加红字体是限制匿名用户访问,如果未登录就会直接跳转到Login.aspx页面,如果有特殊用户的话,则可以加<allow user="**">就可以了
转载于:https://blog.51cto.com/freeflylove/1107822