简体   繁体   中英

asp.net CreateUserUrl not working

I'm facing a issue, the CreateUserUrl doesn't work for me, I always stay on the login page.And yet i've updated the web.Config file as this

<system.web>
  <compilation debug="true" targetFramework="4.5.1" />
  <httpRuntime targetFramework="4.5.1" />
  <pages theme="Blue" >        
  </pages>
  <membership>
    <providers>
      <clear/>
      <remove name="AspNetSqlMembershipProvider" />
      <add name="AspNetSqlMembershipProvider"
        type="System.Web.Security.SqlMembershipProvider"
        connectionStringName="LocalSqlServer"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        applicationName="Dorknozzle"
        requiresUniqueEmail="true"
        passwordFormat="Hashed"
        maxInvalidPasswordAttempts="10"
        minRequiredPasswordLength="7"
        minRequiredNonalphanumericCharacters="1"
        passwordAttemptWindow="10"
        passwordStrengthRegularExpression=""/>
    </providers>
  </membership>
  <authentication mode="Forms">
    <forms name=".LoginCookie" loginUrl="Login.aspx" protection="All" timeout="40" path="/" cookieless="UseUri">
    </forms>
  </authentication>
  <authorization>
    <deny users="?"/>
  </authorization>
</system.web>

<!-- Allow access to create user account -->
<location path="~/MemberShip/CreatingUserAccounts.aspx">
<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>
</location>

See below the login.aspx. The CreateUserUrl is, i think, well set

<!--Login.aspx-->
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Login ID="LoginUser" runat="server" TextLayout="TextOnTop" 
      CreateUserText ="Not Registered Yet ? Create a new account"
      CreateUserUrl ="~/MemberShip/CreatingUserAccounts.aspx"
      TitleText =""
      RememberMeSet="true"
      ReturnUrl ="Default.aspx">
    </asp:Login>
</asp:Content>

Thanks in advance.

更改allow users =“ *”以允许users =“?”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM