webconfig代码如下:
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="2000"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<customErrors mode="RemoteOnly" defaultRedirect="Error/Error.aspx">
<!--<error statusCode="403" redirect="Error\\403.htm" />
<error statusCode="404" redirect="Error\\404.htm" />
<error statusCode="500" redirect="Error\\500.htm" />-->
</customErrors>
为什么加上 <deny users="?"/>
<allow users="*"/>
页面就错位了!
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="2000"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<customErrors mode="RemoteOnly" defaultRedirect="Error/Error.aspx">
<!--<error statusCode="403" redirect="Error\\403.htm" />
<error statusCode="404" redirect="Error\\404.htm" />
<error statusCode="500" redirect="Error\\500.htm" />-->
</customErrors>
为什么加上 <deny users="?"/>
<allow users="*"/>
页面就错位了!
因为你的权限也 禁止了文件夹的读
在你的文件夹 里面新建 Web.config
然后写代码
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</configuration>这样绝对没问题了
<allow users="*"/>-----> <allow users="*"/>
<deny users="?"/>
<location path="允许匿名访问的文件夹名称或者文件路径">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>