473,386 Members | 1,609 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,386 software developers and data experts.

Getting other data from Membership Provider

Hi,

I am using a membership provider in .net 2.0 for all my customer login
etc.

I am using their email address as their username which
User.Identity.Name will give me.

I want the actual Id (which I have against each user in my database at
the PK) for my user though so that I can reference them for other
information. I don't really want to have to use the email as a lookup
everytime.

Could anyone tell me how to do this?

Thanks

Dave

Mar 19 '06 #1
4 944
Just been thinking and I guess what I am saying is that I want them to
use their email address as their username, but I want to store their
UserId as the Membership Provider name/Id.

Could anyone help?

Thanks

Dave

Mar 19 '06 #2
Here's some stuff I've used in a test page...

if (Page.User.Identity.Name != "")
{
Label1.Text = "<b>Membership.GetUser( ).ProviderUserKey: </b>"
+ Membership.GetUser( ).ProviderUserKey.ToString()
+ "<br />"
}
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

"Dave" <bu****@wizardbuy.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
Just been thinking and I guess what I am saying is that I want them to
use their email address as their username, but I want to store their
UserId as the Membership Provider name/Id.

Could anyone help?

Thanks

Dave

Mar 19 '06 #3
Thanks for the response, but I was hoping to avoid making a second call
to get the Id. This seems like a step back from what I used to be able
to do.

Is the answer that I should be doing my membership stuff manually or
can the membership provider still do this?

Mar 20 '06 #4
AFIK that's as good as it gets and I don't see where you get "second call"
from.
First of all we need to determine if the user is logged in and if so then
get the ID.
That's as direct as it gets ainna?

<%= Clinton Gallagher

"Dave" <bu****@wizardbuy.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Thanks for the response, but I was hoping to avoid making a second call
to get the Id. This seems like a step back from what I used to be able
to do.

Is the answer that I should be doing my membership stuff manually or
can the membership provider still do this?

Mar 22 '06 #5

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

Similar topics

3
by: ad | last post by:
I have create a custom membership provider. The common usage of custom membership is set it as default Membership Provider win web.config, and use login controls with it. How can I use custom...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
2
by: Balaji | last post by:
Hi All, Can I use more than one membership provider for a given website? I understand only one of them could be default one. If yes, then how to programmatically access the other membership...
3
by: ryan.mclean | last post by:
Hello everyone, I am wondering, can the membership provider be changed at runtime? Perhaps the connectionStringName? I would like to use a different database based on the server the site is...
4
by: thomas | last post by:
Hello All, How to change the default Membership Provider during the runtime? I know I can reference any provider I want, e.g.: provider = Membership.Providers but the question is how to...
4
by: Scott M. | last post by:
When profile data is stored in ASP .NET, where is the user data persisted? For how long is it persisted: is it session persisted or permanent (like a cookie)?
1
by: =?Utf-8?B?WmhlbmcgQ2hlbg==?= | last post by:
I have an aspnetdb database sitting in different domain with the web server. To authenticate a user and populate membership provider, WCF is used. However, I have no idea how to pass the membership...
2
by: Andy B | last post by:
I have a database with asp.net membership inside it. How would I use it for 2 or more web applications at the same time?
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.