Membership questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Membership questions

    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

    #2
    Re: Membership questions

    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]




    "John" <info@nospam.in fovis.co.ukwrot e in message
    news:Ot4yWHLwIH A.552@TK2MSFTNG P06.phx.gbl...
    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
    >
    >

    Comment

    • Munna

      #3
      Re: Membership questions

      On May 28, 4:58 pm, "John" <i...@nospam.in fovis.co.ukwrot e:
      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.Upda teUser() and pass in this object to update
      the database."


      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



      Best of luck

      Munna


      Comment

      • Registered User

        #4
        Re: Membership questions

        On Wed, 28 May 2008 11:58:58 +0100, "John" <info@nospam.in fovis.co.uk>
        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 MembershipProvi der 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.

        Comment

        • John

          #5
          Re: Membership questions

          Thanks everyone.

          Is this login correct?

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

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

          Membership.Upda teUser(User)

          EnableUser = (Membership.Get User(Email).IsA pproved = True)
          End Function

          Many Thanks

          Regards

          "Munna" <munnaonc@gmail .comwrote in message
          news:e40558da-2ce4-4676-9402-463801de4461@x3 5g2000hsb.googl egroups.com...
          On May 28, 4:58 pm, "John" <i...@nospam.in fovis.co.ukwrot e:
          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.Upda teUser() and pass in this object to update
          the database."


          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



          Best of luck

          Munna



          Comment

          Working...