Membership questions

Discussion in 'ASP .Net' started by John, May 28, 2008.

  1. John

    John Guest

    Hi

    1. Is it possible to disable a user without deleting?

    2. Is it possible to add user fields to the membership db such as app's on
    id for a user?

    Thanks

    Regards
     
    John, May 28, 2008
    #1
    1. Advertising

  2. 1. MembershipUser.IsApproved = false

    2. You can use user profiles, but it is easier to maintain a separate table
    with extra fields.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "John" <> wrote in message
    news:...
    > Hi
    >
    > 1. Is it possible to disable a user without deleting?
    >
    > 2. Is it possible to add user fields to the membership db such as app's on
    > id for a user?
    >
    > Thanks
    >
    > Regards
    >
    >
     
    Eliyahu Goldin, May 28, 2008
    #2
    1. Advertising

  3. John

    Munna Guest

    On May 28, 4:58 pm, "John" <> wrote:
    > Hi
    >
    > 1. Is it possible to disable a user without deleting?
    >
    > 2. Is it possible to add user fields to the membership db such as app's on
    > id for a user?
    >
    > Thanks
    >
    > Regards


    > 1. Is it possible to disable a user without deleting?

    yes... i found few tips in scott'g's blog
    here it goes

    "What you want to-do is actually set the "IsApproved" property on the
    MembershipUser to true or false. When it is false, then the user
    exists but can't login. This is similar to your active/inactive
    logic

    Once you set this property on the MembershipUser object, you'll also
    want to call Membership.UpdateUser() and pass in this object to update
    the database."

    http://weblogs.asp.net/scottgu/arch...ion_2C00_-and-Security-Resources-.aspx#563921

    > 2. Is it possible to add user fields to the membership db such as app's on


    it just a database ... do whatever you want and handle them manually

    Scott Mitchell wrote a beautiful serise of article on membership also
    check out this

    http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

    Best of luck

    Munna
    www.munna.shatkotha.com
     
    Munna, May 28, 2008
    #3
  4. On Wed, 28 May 2008 11:58:58 +0100, "John" <>
    wrote:

    >Hi
    >
    >1. Is it possible to disable a user without deleting?
    >

    Yes, as others have said examine the IsApproved property of the
    MembershipUser type.

    >2. Is it possible to add user fields to the membership db such as app's on
    >id for a user?
    >

    Again yes. You might consider deriving MembershipProvider and
    MembershipUser types specifically tor the application's needs and
    requirements. Methods and properties can be added to the derived
    MembershipUser type to access the additional membership functionality.

    regards
    A.G.
     
    Registered User, May 28, 2008
    #4
  5. John

    John Guest

    Thanks everyone.

    Is this login correct?

    Public Function EnableUser(ByVal Email As String) As Boolean
    Dim User As MembershipUser = Nothing

    User = Membership.GetUser(Email) ' I am using Email as username
    User.IsApproved = True

    Membership.UpdateUser(User)

    EnableUser = (Membership.GetUser(Email).IsApproved = True)
    End Function

    Many Thanks

    Regards

    "Munna" <> wrote in message
    news:...
    On May 28, 4:58 pm, "John" <> wrote:
    > Hi
    >
    > 1. Is it possible to disable a user without deleting?
    >
    > 2. Is it possible to add user fields to the membership db such as app's on
    > id for a user?
    >
    > Thanks
    >
    > Regards


    > 1. Is it possible to disable a user without deleting?

    yes... i found few tips in scott'g's blog
    here it goes

    "What you want to-do is actually set the "IsApproved" property on the
    MembershipUser to true or false. When it is false, then the user
    exists but can't login. This is similar to your active/inactive
    logic

    Once you set this property on the MembershipUser object, you'll also
    want to call Membership.UpdateUser() and pass in this object to update
    the database."

    http://weblogs.asp.net/scottgu/arch...ion_2C00_-and-Security-Resources-.aspx#563921

    > 2. Is it possible to add user fields to the membership db such as app's on


    it just a database ... do whatever you want and handle them manually

    Scott Mitchell wrote a beautiful serise of article on membership also
    check out this

    http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

    Best of luck

    Munna
    www.munna.shatkotha.com
     
    John, May 28, 2008
    #5
    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. =?Utf-8?B?Y2hyaXM=?=

    login control and membership questions

    =?Utf-8?B?Y2hyaXM=?=, Oct 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    343
    =?Utf-8?B?Y2hyaXM=?=
    Oct 4, 2006
  2. John

    Membership questions

    John, Feb 20, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    332
  3. Ali Syed
    Replies:
    3
    Views:
    578
    Mark McIntyre
    Oct 13, 2004
  4. Tino Donderwinkel
    Replies:
    2
    Views:
    801
    Tino Donderwinkel
    Jun 18, 2008
  5. David Lozzi

    Membership Questions

    David Lozzi, Mar 22, 2007, in forum: ASP .Net Security
    Replies:
    0
    Views:
    111
    David Lozzi
    Mar 22, 2007
Loading...

Share This Page