Membership & Roles

Giganews Newsgroups
Subject: Membership & Roles
Posted by:  Allen (ats…@ignore.hotmail.ignore.com)
Date: Wed, 18 Feb 2009

Good afternoon.  I have a web application created in VS.Net 2005.  I have
configured the database and can create users and reset passwords etc.
However, when a user enters username and password into the login control
and hits enter the login page just refreshes and no redirection to
Default.aspx takes place.  I have stepped through the code in the
Login1_Authenticate event and the user is authenticated. For this I use the
following code:

Protected Sub Login1_Authenticate(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.AuthenticateEventArgs) Handles
Login1.Authenticate

If Membership.ValidateUser(Me.Login1.UserName, Me.Login1.Password)                 
Then
            e.Authenticated = True
        Else
            e.Authenticated = False
        End If
End Sub

In my web.config I have the following:
<authentication mode="Forms">
            <forms name="AuthCookie" path="/" loginUrl="login.aspx"
timeout="10"></forms>
        </authentication>
        <membership defaultProvider="CustomizedProvider"
userIsOnlineTimeWindow="20">
            <providers>
                <clear />
                <add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="RSDMConnStr" requiresUniqueEmail="false"
requiresQuestionAndAnswer="true" passwordFormat="Clear"
enablePasswordRetrieval="true" enablePasswordReset="true"
minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8"
applicationName="RSDM" />
            </providers>
        </membership>
        <authorization>
            <deny users="*" />
        </authorization>
        
        <roleManager enabled="true" defaultProvider="CustomizedProvider"
cacheRolesInCookie="true" cookieName=".RSDMROLES" cookieTimeout="30"
cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true"
cookieProtection="All">
            <providers>
                <clear />
                <add name="CustomizedProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="RSDMConnStr" applicationName="RSDM" />
            </providers>
        </roleManager>

Is there something missing or wrong here?

Second question concerns sub directories.  I want to ahve three or four
pages that anybody can view and then I want to have a directory containing
pages that users need to be logged in to see.  Do I need to have a seperate
web.config or can I adapt the main web.config to do this?

TIA

--
ats@jbex

It's easy to lay down and hide
Where's the warrior without his pride?

Adam and The Ants - Dog Eat Dog

Replies