試圖限制匿名用戶登錄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