Why no UserID property in the Membership class?

I

ILaughLouder

Hi all.

Does anyone know why there is no UserID in the Membership class? I
think it's because the ASP.NET team wants developers to use their own
User class in conjunction with the Membership and Profile classes. But
it's doesn't make any sense, when you already got the user name, email
address, last login etc. Is the only easy alternative to store the user
id in a session? That's not at all OO!!

I really don't get it. Everyone uses the user id for queries and yeah
anything else where you need to do something user specific. Their
should had got it right in ASP.NET 1.1, but nooooo.

Am I the only one who think this is crazy?
 
I

ILaughLouder

I've been studying the ASP.NET 2.0 starter kits and all of them seems
to make queries based on user name, except when they use XSD
(auto-generated code) file queries. No one thinks it's weird not to
have a GetUserId method in either the Membership, MemberShipUser,
Profile or Identity class?!?

What do you normally do?

(e-mail address removed) skrev:
 
M

Mark Fitzpatrick

Take a look again. If you look at the MembershipUser class you'll notice a
property called ProviderUserKey. This should return the identifier for the
user as an object. The system returns an object because, using different
providers, it could need to be different things. It could be an int, or in
the case of using a SQL Server provider, a GUID.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
I

ILaughLouder

Thanks, I'll look into it. Have to use a firebird provider though.
Mark Fitzpatrick skrev:
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top