Getting other data from Membership Provider

D

Dave

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
 
D

Dave

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
 
C

clintonG

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/
 
D

Dave

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?
 
C

clintonG

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
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top