473,796 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebControls.Log in.MembershipPr ovider

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.Log in 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 "MembershipProv ider" 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 ="CustomizedRol eProvider">
<providers>
<add name="Customize dRoleProvider"
type="System.We b.Security.SqlR oleProvider"
connectionStrin gName="DBCS" />
</providers>
</roleManager>

<membership defaultProvider ="CustomizedMem bershipProvider ">
<providers>
<add name="Customize dMembershipProv ider"
type="System.We b.Security.SqlM embershipProvid er"
connectionStrin gName="DBCS"
minRequiredNona lphanumericChar acters="0"
minRequiredPass wordLength="7" />
</providers>
</membership>

Any help is appreciated!

Thanks,
Steven

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

The user that got created was being inserted with an "Applicatio n" 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 ="CustomizedMem bershipProvider ">
<providers>
<add name="Customize dMembershipProv ider"
type="System.We b.Security.SqlM embershipProvid er"
applicationName ="/myApp"
connectionStrin gName="MyDBC"
minRequiredNona lphanumericChar acters="0"
minRequiredPass wordLength="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 "Applicatio n" 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 ="CustomizedMem bershipProvider ">
<providers>
<add name="Customize dMembershipProv ider"
type="System.We b.Security.SqlM embershipProvid er"
applicationName ="/myApp"
connectionStrin gName="MyDBC"
minRequiredNona lphanumericChar acters="0"
minRequiredPass wordLength="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
14569
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 server. I am able to log in. However after publishing the page to my local IIS, it results in the below error. This error is occurring on the Visual Studio.Net 2k5 release version, but did not occur on the beta 2, same code. A point of interest, is...
1
2553
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? My login aspx: <asp:Login ID="Login1" runat="server" BackColor="#FFFFCC" BorderColor="#5400A8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px"
2
4268
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, it can't login in. I tried again and again. When I login with incorrect password, the login control display the FailureText. But when I enter the correct password, the Failure Text disappear but it still stay in the login page.
1
4683
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 Authenticate event, and MembershipProvider to my custom provider. Converted the Login control to a Template and added an additional <asp:Label AssociatedControlID=Department ...>Department, <asp:TextBox ID=Department ....and...
9
2404
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" message to user. If the ID and password are correct, my program wiill transfer to home.aspx After my program deployment to server, when user login with correct ID and wrong pw, it display "password is wrong" message. But if the ID and password...
3
1505
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 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:
3
6393
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 login page, all my tests fail. Here is some of the login page code: <asp:Login ID="Login1" runat="server" Height="134px" OnAuthenticate="Login1_Authenticate" OnLoginError="OnLoginError" Width="336px" CreateUserText="Create a...
1
3606
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 looks like the user is not really logged in ( Verified using the LoginView control ) ¿¿ What could be the possible reasons for that problem ?? Thanks in advance !!!
0
1445
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 "http://IP:portname" or "http://localhost:portname" Web site has custom 'Login control' and custom 'Membership provider'; and I do not have access to 'Login control' control code. MembershipProvider::Validateuser() is returning true irrespective of...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.