Profiles & Membership

Discussion in 'ASP .Net' started by =?Utf-8?B?QV9SZXB1YmxpY2Fu?=, Jun 27, 2007.

  1. This is a portion of my Web.config file:

    <system.web>
    <membership defaultProvider="SqlProvider">
    <providers>
    <clear/>
    <add name="SqlProvider"
    type="System.Web.Security.SqlMembershipProvider"
    connectionStringName="SqlServices"
    applicationName="CollegeRepublicans"
    minRequiredPasswordLength="8"
    minRequiredNonalphanumericCharacters="0"
    enablePasswordRetrieval="true"
    enablePasswordReset="true"
    passwordFormat="Encrypted"
    requiresQuestionAndAnswer="true" />
    </providers>
    </membership>


    <profile defaultProvider="SqlProvider">
    <providers>
    <add name="SqlProvider"
    type="System.Web.Profile.SqlProfileProvider"
    connectionStringName="SqlServices" />
    </providers>
    <properties>
    <add name="UserName" defaultValue="" allowAnonymous="true" />
    <add name="FirstName" defaultValue="" allowAnonymous="true" />
    <add name="LastName" defaultValue="" allowAnonymous="true" />
    <add name="StreetAddress" defaultValue="" allowAnonymous="true" />
    <add name="City" defaultValue="" allowAnonymous="true" />
    <add name="State" defaultValue="" allowAnonymous="true" />
    <add name="ZipCode" defaultValue="" allowAnonymous="true" />
    <add name="EmailAddress" defaultValue="" allowAnonymous="true" />
    <add name="HomePhoneNumber" defaultValue="" allowAnonymous="true" />
    <add name="CellPhoneNumber" defaultValue="" allowAnonymous="true" />
    <add name="Volunteer" defaultValue="" allowAnonymous="true" />
    </properties>
    </profile>
    </system.web>







    This is how I create a new user and profile:
    Try
    'Create the profile
    ProfileBase.Create(CreateUserWizard.UserName)

    'Gather profile information
    Profile.UserName = CleanString(CreateUserWizard.UserName)
    Profile.FirstName = CleanString(CustomProfileInfo.FirstName)
    Profile.LastName = CleanString(CustomProfileInfo.LastName)
    Profile.StreetAddress =
    CleanString(CustomProfileInfo.StreetAddress)
    Profile.City = CleanString(CustomProfileInfo.City)
    Profile.State = CleanString(CustomProfileInfo.State)
    Profile.ZipCode = CleanString(CustomProfileInfo.ZipCode)
    Profile.EmailAddress = CreateUserWizard.Email
    Profile.HomePhoneNumber =
    CleanString(CustomProfileInfo.HomePhoneNumber)
    Profile.CellPhoneNumber =
    CleanString(CustomProfileInfo.CellPhoneNumber)
    Profile.Volunteer = CleanString(CustomProfileInfo.Volunteer)

    'Default each new user to the role of USER
    Roles.AddUserToRole(CreateUserWizard.UserName, "User")
    Catch strError As Exception
    'WriteLog(strError.Message)
    End Try



    This is how I delete a user:
    Private Function DeleteUser(ByVal strUserName As String) As Boolean
    Dim blnResult As Boolean = False

    Try
    'Delete the users profile
    If blnResult = ProfileManager.DeleteProfile(strUserName) = True
    Then
    'Delete the users membership
    If blnResult = Membership.DeleteUser(strUserName) = True Then
    blnResult = True
    End If
    End If
    Catch strError As Exception
    'WriteLog(strError.Message)
    End Try

    Return blnResult
    End Function






    There are many problems I am having;
    1. When adding a new user sometimes there profile information doesn't get
    added
    2. When adding a new user sometimes they don't get added to the membership
    3. When adding a new user sometimes they over write existing profile
    information to current users.
    4. When updating a current users profile it creates duplicate profile records
    5. When displaying all the user in a GridView using the GetAllUsers method
    it doesn't always display every user, if at all.
    6. Deleting users does not work, nor does it delete their profile.

    Can anyone help?

    Thanks
    =?Utf-8?B?QV9SZXB1YmxpY2Fu?=, Jun 27, 2007
    #1
    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?V2FycmVuIFNpcm90YQ==?=

    Is there an OO way to access all the profiles/membership info

    =?Utf-8?B?V2FycmVuIFNpcm90YQ==?=, Dec 23, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    267
    =?Utf-8?B?V2FycmVuIFNpcm90YQ==?=
    Dec 23, 2006
  2. dgk
    Replies:
    2
    Views:
    423
  3. A_Republican

    Profiles & Membership

    A_Republican, May 25, 2007, in forum: ASP .Net Security
    Replies:
    1
    Views:
    103
    Reecio
    Jul 2, 2007
  4. A_Republican

    Membership & Profiles

    A_Republican, May 25, 2007, in forum: ASP .Net Security
    Replies:
    6
    Views:
    173
    A_Republican
    May 31, 2007
  5. A_Republican

    Profiles & Membership

    A_Republican, Jun 27, 2007, in forum: ASP .Net Security
    Replies:
    0
    Views:
    123
    A_Republican
    Jun 27, 2007
Loading...

Share This Page