Why no UserID property in the Membership class?

Discussion in 'ASP .Net' started by ILaughLouder@gmail.com, Aug 16, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Guest

    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?

    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, 2006
    #2
    1. Advertising

  3. 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

    <> wrote in message
    news:...
    > 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?
    >
    Mark Fitzpatrick, Aug 16, 2006
    #3
  4. Guest

    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
    >
    > <> wrote in message
    > news:...
    > > 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, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    712
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,762
    Smokey Grindel
    Dec 2, 2006
  3. perplexed
    Replies:
    10
    Views:
    855
    Juan T. Llibre
    Jan 28, 2007
  4. mazdotnet
    Replies:
    0
    Views:
    651
    mazdotnet
    Sep 12, 2007
  5. TdarTdar
    Replies:
    15
    Views:
    262
    André da Silva Carrilho
    Jul 28, 2006
Loading...

Share This Page