繁体   English   中英

asp.net CreateUserUrl无法正常工作

[英]asp.net CreateUserUrl not working

我遇到了一个问题,CreateUserUrl对我不起作用,我一直停留在登录页面上,但是我已经更新了web.Config文件

<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>

参见下面的login.aspx。 我认为CreateUserUrl设置合理

<!--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>

提前致谢。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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