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

Why no UserID property in the Membership class?

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?

Aug 16 '06 #1
3 1340
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?

IL**********@gmail.com skrev:
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?
Aug 16 '06 #2
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

<IL**********@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
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?

Aug 16 '06 #3
Thanks, I'll look into it. Have to use a firebird provider though.
Mark Fitzpatrick skrev:
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

<IL**********@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
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?
Aug 16 '06 #4

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

Similar topics

1
by: Hardy Wang | last post by:
Hi, I have my own user table with definition like UserID int not null primary key, Username varchar(50) not null, Password varchar(50) not null, Firstname varchar(50) not null, Lastname...
0
by: neilmcguigan | last post by:
hello, how do i get the userid from the membership provider when the user is anonymous? there is the Membership.GetUser method, but it seems to return null when the user anonymous. Just do a...
10
by: perplexed | last post by:
After a user logs in (ASP.NET 2.0 membership/roles), how do I programmatically access their UserId and other information stored in the ASP.NET database structure? A user may login at Login.aspx...
13
by: Kirk | last post by:
I have been reading Scott Allen's article on Master Pages (http:// odetocode.com/Articles/450.aspx) but I am having problems understanding a concept. Specifically, I have created a property...
0
by: mazdotnet | last post by:
Hi, I'm trying to get the 'User Information' by using the UserId and it doesn't work. This works, MembershipUser membershipUser = Membership.GetUser("username");
0
by: mazdotnet | last post by:
Hi, I'm trying to get the 'User Information' by using the UserId and it doesn't work. This works, MembershipUser membershipUser = Membership.GetUser("username"); tbxUsername.Text =...
1
by: Keith G Hicks | last post by:
Asp.net 2.0 - coding in VB I'm trying to get the UserID of the last created user so I can use the value in another table. I'm not finding anything otu there that works for what I'm trying to do....
1
by: Bogdan | last post by:
Hi, I'd like to take a full advantage of built-in membership services and use aspnetdb's UserId in my app's database. For example, I'd like to establish some relationships between membership...
21
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.