试图限制匿名用户登录login.aspx,register.aspx和Site.css文件并进行身份验证以访问整个站点。 当前anonymous可以访问login.aspx和Site.css,因为样式显示正确。但是,当我点击register.aspx链接时,我被重定向到login.aspx页面。有权访问register.aspx但被重定向到登录页面的匿名用户
在web根目录下我的web.config。目录结构中没有其他web.configs。我不知道我是否应该寻找其他地方(我知道WSAT有时可以保持规则,但不知道是否被根Web.config取代)。
只是想登录和注册文件引用母版页,这是否也需要明确的授权?虽然不能解释为什么登录工作的匿名,但注册不。
感谢您的帮助!安东尼。
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="************"
connectionString="Data Source=**********; Initial Catalog=************; Integrated Security=SSPI; Persist Security Info=False; Trusted_Connection=Yes"
providerName="System.Data.SqlClient" />
</connectionStrings>
<location path="Register.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
<location path="Site.css">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Website/Login.aspx" timeout="2880" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="8" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="***********" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="**********" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="***********" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
入住提琴手或'Network'选项卡浏览器的开发工具,这要求!返回401代码 – 2013-03-01 09:14:53