Membership Provider

Discussion in 'ASP .Net' started by Morgan, Dec 6, 2005.

  1. Morgan

    Morgan Guest

    Sorry for cross post, forgot to include aspnet in orinal...

    Thanks in advance for any assistance.

    I'm in the process of implementing custom RoleProvider & Membership Provider
    objects and have run into a snag with the Membership Provider.

    It seems many of the MembershipUser properties are read-only. This seems,
    well stupid, IMO.

    I can override these in a class that inherits from MembershipUser and set
    them via parameters in the constructor, but that's a lot of work for what
    seems should be read-write properties, especially when implementing a custom
    provider for another data store. For example, IsLockedOut is read
    only?Shouldn't I be able to write to this property when returning a
    MembershipUser for the GetUser method?

    My question is, is there any other way to access these read only properties?
    Have I missed something obvious?

    Thanks again,

    Morgan
    Morgan, Dec 6, 2005
    #1
    1. Advertising

  2. Hi Morgan,

    Welcome to ASPNET newsgroup.
    As for the MembershipUser class, yes, it has many properteis defined as
    readonly. Based on my understanding, those properties are mainly configured
    through administration interfaces(most of such methods are defined in
    MembershipProvider class), e.g lock a user when the user created and then
    active through updating later(through the
    SqlMembershipProvider.UnlockUser()).... And all these information stored in
    database should not changed outside by normal client application which use
    the membership info.... Client application just need to query these
    information through GetUser method(retrieved from backend database
    storage).... I think that's the reason the buildin MembershipUser class
    marked them as readonly .... Of course, we can override or replace them
    to all read/writeable in our custom membership framework....

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)






    --------------------
    | From: "Morgan" <>
    | Subject: Membership Provider
    | Date: Tue, 6 Dec 2005 12:15:29 -0500
    | Lines: 25
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | Message-ID: <#HQKhfo#>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 168-215-79-61.gen.twtelecom.net 168.215.79.61
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:363128
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Sorry for cross post, forgot to include aspnet in orinal...
    |
    | Thanks in advance for any assistance.
    |
    | I'm in the process of implementing custom RoleProvider & Membership
    Provider
    | objects and have run into a snag with the Membership Provider.
    |
    | It seems many of the MembershipUser properties are read-only. This seems,
    | well stupid, IMO.
    |
    | I can override these in a class that inherits from MembershipUser and set
    | them via parameters in the constructor, but that's a lot of work for what
    | seems should be read-write properties, especially when implementing a
    custom
    | provider for another data store. For example, IsLockedOut is read
    | only?Shouldn't I be able to write to this property when returning a
    | MembershipUser for the GetUser method?
    |
    | My question is, is there any other way to access these read only
    properties?
    | Have I missed something obvious?
    |
    | Thanks again,
    |
    | Morgan
    |
    |
    |
    Steven Cheng[MSFT], Dec 7, 2005
    #2
    1. Advertising

  3. Morgan

    Morgan Guest

    Thanks, Steven.

    "Steven Cheng[MSFT]" <> wrote in message
    news:iCpF$Ju%...
    > Hi Morgan,
    >
    > Welcome to ASPNET newsgroup.
    > As for the MembershipUser class, yes, it has many properteis defined as
    > readonly. Based on my understanding, those properties are mainly
    > configured
    > through administration interfaces(most of such methods are defined in
    > MembershipProvider class), e.g lock a user when the user created and then
    > active through updating later(through the
    > SqlMembershipProvider.UnlockUser()).... And all these information stored
    > in
    > database should not changed outside by normal client application which use
    > the membership info.... Client application just need to query these
    > information through GetUser method(retrieved from backend database
    > storage).... I think that's the reason the buildin MembershipUser class
    > marked them as readonly .... Of course, we can override or replace them
    > to all read/writeable in our custom membership framework....
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    >
    >
    >
    > --------------------
    > | From: "Morgan" <>
    > | Subject: Membership Provider
    > | Date: Tue, 6 Dec 2005 12:15:29 -0500
    > | Lines: 25
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    > | X-RFC2646: Format=Flowed; Original
    > | Message-ID: <#HQKhfo#>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | NNTP-Posting-Host: 168-215-79-61.gen.twtelecom.net 168.215.79.61
    > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    > | Xref: TK2MSFTNGXA02.phx.gbl
    > microsoft.public.dotnet.framework.aspnet:363128
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > |
    > | Sorry for cross post, forgot to include aspnet in orinal...
    > |
    > | Thanks in advance for any assistance.
    > |
    > | I'm in the process of implementing custom RoleProvider & Membership
    > Provider
    > | objects and have run into a snag with the Membership Provider.
    > |
    > | It seems many of the MembershipUser properties are read-only. This
    > seems,
    > | well stupid, IMO.
    > |
    > | I can override these in a class that inherits from MembershipUser and
    > set
    > | them via parameters in the constructor, but that's a lot of work for
    > what
    > | seems should be read-write properties, especially when implementing a
    > custom
    > | provider for another data store. For example, IsLockedOut is read
    > | only?Shouldn't I be able to write to this property when returning a
    > | MembershipUser for the GetUser method?
    > |
    > | My question is, is there any other way to access these read only
    > properties?
    > | Have I missed something obvious?
    > |
    > | Thanks again,
    > |
    > | Morgan
    > |
    > |
    > |
    >
    Morgan, Dec 8, 2005
    #3
  4. You're welcome Norgan,

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | From: "Morgan" <>
    | References: <#HQKhfo#>
    <iCpF$Ju#>
    | Subject: Re: Membership Provider
    | Date: Wed, 7 Dec 2005 21:15:20 -0500
    | Lines: 89
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | Message-ID: <OF#y505#>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 12-222-91-80.client.insightbb.com 12.222.91.80
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:363534
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Thanks, Steven.
    |
    | "Steven Cheng[MSFT]" <> wrote in message
    | news:iCpF$Ju%...
    | > Hi Morgan,
    | >
    | > Welcome to ASPNET newsgroup.
    | > As for the MembershipUser class, yes, it has many properteis defined as
    | > readonly. Based on my understanding, those properties are mainly
    | > configured
    | > through administration interfaces(most of such methods are defined in
    | > MembershipProvider class), e.g lock a user when the user created and
    then
    | > active through updating later(through the
    | > SqlMembershipProvider.UnlockUser()).... And all these information
    stored
    | > in
    | > database should not changed outside by normal client application which
    use
    | > the membership info.... Client application just need to query these
    | > information through GetUser method(retrieved from backend database
    | > storage).... I think that's the reason the buildin MembershipUser
    class
    | > marked them as readonly .... Of course, we can override or replace
    them
    | > to all read/writeable in our custom membership framework....
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | >
    | >
    | >
    | >
    | > --------------------
    | > | From: "Morgan" <>
    | > | Subject: Membership Provider
    | > | Date: Tue, 6 Dec 2005 12:15:29 -0500
    | > | Lines: 25
    | > | X-Priority: 3
    | > | X-MSMail-Priority: Normal
    | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | > | X-RFC2646: Format=Flowed; Original
    | > | Message-ID: <#HQKhfo#>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | NNTP-Posting-Host: 168-215-79-61.gen.twtelecom.net 168.215.79.61
    | > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    | > | Xref: TK2MSFTNGXA02.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet:363128
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > |
    | > | Sorry for cross post, forgot to include aspnet in orinal...
    | > |
    | > | Thanks in advance for any assistance.
    | > |
    | > | I'm in the process of implementing custom RoleProvider & Membership
    | > Provider
    | > | objects and have run into a snag with the Membership Provider.
    | > |
    | > | It seems many of the MembershipUser properties are read-only. This
    | > seems,
    | > | well stupid, IMO.
    | > |
    | > | I can override these in a class that inherits from MembershipUser and
    | > set
    | > | them via parameters in the constructor, but that's a lot of work for
    | > what
    | > | seems should be read-write properties, especially when implementing a
    | > custom
    | > | provider for another data store. For example, IsLockedOut is read
    | > | only?Shouldn't I be able to write to this property when returning a
    | > | MembershipUser for the GetUser method?
    | > |
    | > | My question is, is there any other way to access these read only
    | > properties?
    | > | Have I missed something obvious?
    | > |
    | > | Thanks again,
    | > |
    | > | Morgan
    | > |
    | > |
    | > |
    | >
    |
    |
    |
    Steven Cheng[MSFT], Dec 8, 2005
    #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. BS
    Replies:
    3
    Views:
    2,044
    Alvin Bruney [MVP]
    Jun 17, 2004
  2. Nate Hekman
    Replies:
    0
    Views:
    3,003
    Nate Hekman
    Apr 25, 2005
  3. spp

    Sql Membership provider

    spp, Oct 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    514
  4. sloan
    Replies:
    5
    Views:
    1,497
    sloan
    Jun 4, 2006
  5. sloan
    Replies:
    1
    Views:
    500
    Chad Scharf
    Jul 3, 2007
Loading...

Share This Page