如何将我的注册页面从表单身份验证重定向到登录页面

How can i exclude my register page from Form Authentication Redirect to login page

正如标题所说,我正试图从表单身份验证重定向中排除一些页面,例如我的 register.aspx,这是我的 web.config

<authentication mode="Forms">
  <forms name="MyAppCookie" loginUrl="Login.aspx" protection="All" timeout="120" defaultUrl="Default.aspx"/>
</authentication>
<authorization>
  <deny users="?"/>
</authorization>

在您的 web.config 中使用位置标签。

<location path="register.aspx">
  <system.web>
    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
</location>

有关详细信息,请参阅 this article