473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

WebControls.Login.MembershipProvider

Hidey ho,

C#, ASP.NET, VS2005, SQL Server 2005 Developer

I've used aspnet_regsql to install the membership/role tables into my
application database.
I have confirmed that all the tables are there.
I've also configured the web.config to specify the new database as the
role provider and the membership provider. I have used the "ASP.NET
Configuration" tool to manage users and roles. These are definately
saved to the database mentioned above. All this works great.

I have added a WebControls.Login control to the form and, by default,
the username/password is not accepted (even though the custom
membership provider is specified as default in the web.config). I
changed the property of "MembershipProvider" for the control and
specified my custom membership provider. Still no love.

To trouble shoot, I handled the "LoginError" event of the Login control
and discovered that it doesn't think the username exists which makes me
think its still not talking to the correct database. I DO have SQL
Express installed on the same machine, along with SQL Server 2000 as
well.

Here's my web.config entries for my providers:

<roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="DBCS" />
</providers>
</roleManager>

<membership defaultProvider="CustomizedMembershipProvider">
<providers>
<add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="DBCS"
minRequiredNonalphanumericCharacters="0"
minRequiredPasswordLength="7" />
</providers>
</membership>

Any help is appreciated!

Thanks,
Steven

Sep 17 '06 #1
4 4748
I fixed this problem. For those interested:

The user that got created was being inserted with an "Application" name
of "\myapp" however by default, the web config entry for the membership
provider assumes an application name of "\" so it was querying the
database asking for a user of "steven" in the "\" app instead of the
"\myapp". Even though when I went to the ASP.NET Web configuration, I
clicked the radio that specifies one membership profile per application
(instead of one for ALL applications), it still set up the tables as
though it was going to be reused across multiple applications.

So the actual fix was an entry in the web config for the member
provider, specifying the application name, here's an example:

<membership defaultProvider="CustomizedMembershipProvider">
<providers>
<add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
applicationName="/myApp"
connectionStringName="MyDBC"
minRequiredNonalphanumericCharacters="0"
minRequiredPasswordLength="7" />
</providers>
</membership>
Hope this helps future readers. Don't reply to this if it did, just
send me money.

SN

Sep 18 '06 #2
I've actually banged my head against the wall in the past over this
same problem. Finally I figured out the problem and was cursing the
membership controls.

Steven Nagy wrote:
I fixed this problem. For those interested:

The user that got created was being inserted with an "Application" name
of "\myapp" however by default, the web config entry for the membership
provider assumes an application name of "\" so it was querying the
database asking for a user of "steven" in the "\" app instead of the
"\myapp". Even though when I went to the ASP.NET Web configuration, I
clicked the radio that specifies one membership profile per application
(instead of one for ALL applications), it still set up the tables as
though it was going to be reused across multiple applications.

So the actual fix was an entry in the web config for the member
provider, specifying the application name, here's an example:

<membership defaultProvider="CustomizedMembershipProvider">
<providers>
<add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
applicationName="/myApp"
connectionStringName="MyDBC"
minRequiredNonalphanumericCharacters="0"
minRequiredPasswordLength="7" />
</providers>
</membership>
Hope this helps future readers. Don't reply to this if it did, just
send me money.

SN
Sep 18 '06 #3
Its good that it makes sense once you work out the problem.
And I guess its a mistake you will only make once.
But still, its not as intuitive as it could be.
I've actually banged my head against the wall in the past over this
same problem. Finally I figured out the problem and was cursing the
membership controls.
Sep 18 '06 #4
I agree completely, the first time I tried to figure it out it took me
quite awhile.

Oh well.

Steven Nagy wrote:
Its good that it makes sense once you work out the problem.
And I guess its a mistake you will only make once.
But still, its not as intuitive as it could be.
I've actually banged my head against the wall in the past over this
same problem. Finally I figured out the problem and was cursing the
membership controls.
Sep 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tim Cartwright | last post by:
I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web...
1
by: Dabbler | last post by:
I have a login page which requires all users to login everytime they visit, the remember me feature isn't working. We all have cookies and js enabled. Any suggestions on how to diagnose this? ...
2
by: ad | last post by:
I use login control of VS2005 in my web application. The web applicaiton is developed in my notebook. It run ok in my notebook, but when I login in from another PC with the user ID and password,...
1
by: Andrew Hayes | last post by:
Added the Login and ValidationSummary controls to the default.aspx page of VS2005 web application. Set the DestinationPageURL to a different "members only" page, OnAuthenticate to my custom...
9
by: ad | last post by:
I used login Controls of VS2005 to develop Web application. My program will check password and user ID in login.aspx. If the password is wrong, my program will display an "password is wrong"...
3
by: goot | last post by:
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...
3
by: HeatherBMI | last post by:
I've been searching for a way to test this control with my NUnitASP tests for awhile now and have yet to come up with anything. I have all of my tests written, but until I can get past the initial...
1
by: =?ISO-8859-1?Q?Carlos_Guzm=E1n_=C1lvarez?= | last post by:
Hello: I have custom Membership and Role providers for an ASP.NET application, the problem comes when the Authentication gets done ( and i'm using the Login control, it finished properly ) but...
0
by: asnowfall | last post by:
After logging in, I am not able to redirect to the target url; and this happens only when I connect to the website using "http://machine- name:portname"; but not if I connect using either...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.