Problem creating a new user with form authentication enabled

Discussion in 'ASP .Net Building Controls' started by John, Dec 13, 2005.

  1. John

    John Guest

    Hi

    I have implemented form authentication with login.aspx as the form to call
    if the user is not authenticated using the following in the web.config;

    <authentication mode="Forms">
    <forms name="LoginAuthCookie" loginUrl="Login.aspx">
    </forms>
    </authentication>

    My main page is Default.asp which has the built-in login control. In
    addiction, I have placed another button for any new users wishing to
    register which is set to call register.aspx.

    The problem is that when I press New User button, the register.aspx form
    causes the login.aspx to reappear as the new user is not currently
    registered and hence not logged in. How can I keep register.aspx out of this
    restriction so if the register.aspx is called, login.aspx does not appear
    even if the user is not currently logged in?

    The full web.config file is below.

    Thanks

    Regards



    ============
    WEB.CONFIG

    <?xml version="1.0"?>
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>

    <connectionStrings>
    <add name="Personal" connectionString="Data
    Source=.\MSSQLSERVER;Integrated Security=True;User
    Instance=True;AttachDBFilename=|DataDirectory|Events.mdf"
    providerName="System.Data.SqlClient"/>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data
    Source=.\SQLEXPRESS;Integrated Security=True;User
    Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf"/>
    </connectionStrings>

    <system.web>
    <compilation debug="true" strict="false" explicit="true"/>
    <pages>
    <namespaces>
    <clear/>
    <add namespace="System"/>
    <add namespace="System.Collections"/>
    <add namespace="System.Collections.Specialized"/>
    <add namespace="System.Configuration"/>
    <add namespace="System.Text"/>
    <add namespace="System.Text.RegularExpressions"/>
    <add namespace="System.Web"/>
    <add namespace="System.Web.Caching"/>
    <add namespace="System.Web.SessionState"/>
    <add namespace="System.Web.Security"/>
    <add namespace="System.Web.Profile"/>
    <add namespace="System.Web.UI"/>
    <add namespace="System.Web.UI.WebControls"/>
    <add namespace="System.Web.UI.WebControls.WebParts"/>
    <add namespace="System.Web.UI.HtmlControls"/>
    </namespaces>
    </pages>
    <authentication mode="Forms">
    <forms name="LoginAuthCookie" loginUrl="Login.aspx">
    <!--<credentials passwordFormat="Clear">
    <user name="john" password="password" />
    <user name="mike" password="test" />
    </credentials>-->
    </forms>
    </authentication>

    <authorization>
    <deny users="?" />
    </authorization>

    <!--<membership>
    <providers>
    <add connectionStringName="SqlServices"
    requiresQuestionAndAnswer="false"
    minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
    name="AspNetSqlProvider"
    type="System.Web.Security.SqlMembershipProvider" />
    </providers>
    </membership>-->

    </system.web>
    </configuration>
     
    John, Dec 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    629
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. UJ
    Replies:
    2
    Views:
    353
  3. Javier Martinez
    Replies:
    0
    Views:
    433
    Javier Martinez
    Dec 22, 2005
  4. Chak
    Replies:
    1
    Views:
    377
    Jonathan
    Nov 27, 2003
  5. Replies:
    4
    Views:
    4,143
    Hillbilly
    Oct 9, 2008
Loading...

Share This Page