Login control problems

G

goot

I'm trying to use the login control and have it use the membership
provider framework to authenticate users and am having a problem (which
i'm sure will turn out to be a stupid mistake on my part)... this is
what I have done thus far:

Created a database on a sql 2000 server and then used the aspnet_regsql
tool to create the membership tables


I then modified the web.config as such:

<system.web>
<roleManager enabled="true" />
<membership defaultProvider="CustomizedProvider">
<providers>
<clear />
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="membership"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0" />
</providers>
</membership>
....


Then I used the ASP.NET web site administration utililty to add a
couple users. I also have verified that the tool created the users
successfully by looking in the database that I created above...

finally, I created a login.aspx page and placed in it a single tag that
looks like:

<asp:Login id="loginUser1" runat="server"
MembershipProvider="CustomizedProvider"
DestinationPageUrl="~/default.aspx">

when I attempt to login using the login control... I get:

Your login attempt was not successful. Please try again

I know the username and password are right and have even created more
than one user trying, again, unsuccessfully to login.

Am I wrong in assuming that I don't need to write any code for this to
work... I reflectored the login control to see what it does when the
button is clicked and it calls ValidateUser on the MembershipProvider.
In fact it uses the default membership provider if you don't specify
one via the MembershipProvider property...

Any ideas what I'm doing wrong?
Thanks....
 
S

Steven Nagy

Yeah it was a couple of hours for me to find it too.
And I stumbled across it completely by accident.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top