I have created a page called default.aspx. On this page there is a login control which i have configured by ADO.NET and not by the standard WSAT authentication. On clicking login the user is taken to Home.aspx. What i need is to display a message "Welcome
[username]'. Some suggest using the standard tool in the login menu. But i am not sure whether that would work when you have configured without using WSAT...or would it work? HELP...
The issue is not "WSAT authentication". The issue is that you are not using the standard membership provider for SQL Server. Since this is the case, you best bet would be to create a custom membership provider so that you can use all of the login controls.
Yes, if you're not using the standard/custom providers, the controls won't work for you. You can just fetch the data from the database yourself, which is essentially what the standard controls do.
The default location is C:\Program Files\Microsoft\ASP.NET Provider Toolkit SQL Samples\ and you'll need to copy these files into your web folder. The membership one is SQLMembershipProvider.cs. Using the tutorials is a good way to get to understand the
providers.
Having said that though, you don't have to use the providers. If your needs are simple, then there's nothing stopping you from writing your own login code. To show the user name all you have to do is get the name from databsae once they've logged in. Or,
probably easier, is once they've logged in just store the name in the session, so you don't have to fetch it again.
Marked as answer by achuthan1988 on Apr 25, 2012 12:51 PM
Now i want to know how to retrieve the name of a user which i typed in Page 1 (where the login control is) in page 2 (which is the page i direct the user to).
achuthan1988
Member
53 Points
159 Posts
Doubt regarding login control..
Apr 24, 2012 01:27 AM|LINK
I have created a page called default.aspx. On this page there is a login control which i have configured by ADO.NET and not by the standard WSAT authentication. On clicking login the user is taken to Home.aspx. What i need is to display a message "Welcome [username]'. Some suggest using the standard tool in the login menu. But i am not sure whether that would work when you have configured without using WSAT...or would it work? HELP...
Careed
All-Star
18764 Points
3637 Posts
Re: Doubt regarding login control..
Apr 24, 2012 02:12 AM|LINK
The issue is not "WSAT authentication". The issue is that you are not using the standard membership provider for SQL Server. Since this is the case, you best bet would be to create a custom membership provider so that you can use all of the login controls.
http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx
"The oxen are slow, but the earth is patient."
achuthan1988
Member
53 Points
159 Posts
Re: Doubt regarding login control..
Apr 24, 2012 03:00 AM|LINK
Custom membership looks like a lot of work from the tutorials i have seen anybody have simpler versions.?
Dave Sussman
All-Star
37716 Points
5005 Posts
ASPInsiders
MVP
Re: Doubt regarding login control..
Apr 24, 2012 07:55 AM|LINK
Yes, if you're not using the standard/custom providers, the controls won't work for you. You can just fetch the data from the database yourself, which is essentially what the standard controls do.
The provider route is worthwhile though, since it gives you the control integration. It's less work creating a provider when you know that the source code for the existing providers is freely available at http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi so you can just take this code and modify the SQL to work with your own tables.
achuthan1988
Member
53 Points
159 Posts
Re: Doubt regarding login control..
Apr 24, 2012 11:13 AM|LINK
When i installed the MSI file i couldnt find it in the destination in which i saved the file..(sorry i am new to all this
)?
Dave Sussman
All-Star
37716 Points
5005 Posts
ASPInsiders
MVP
Re: Doubt regarding login control..
Apr 24, 2012 12:15 PM|LINK
The default location is C:\Program Files\Microsoft\ASP.NET Provider Toolkit SQL Samples\ and you'll need to copy these files into your web folder. The membership one is SQLMembershipProvider.cs. Using the tutorials is a good way to get to understand the providers.
Having said that though, you don't have to use the providers. If your needs are simple, then there's nothing stopping you from writing your own login code. To show the user name all you have to do is get the name from databsae once they've logged in. Or, probably easier, is once they've logged in just store the name in the session, so you don't have to fetch it again.
achuthan1988
Member
53 Points
159 Posts
Re: Doubt regarding login control..
Apr 25, 2012 12:37 PM|LINK
Now i want to know how to retrieve the name of a user which i typed in Page 1 (where the login control is) in page 2 (which is the page i direct the user to).
achuthan1988
Member
53 Points
159 Posts
Re: Doubt regarding login control..
Apr 25, 2012 12:52 PM|LINK
I got it to work using sessions
(which i learnt from scratch) . Can i pm you for more doubts ?