+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / manageprofile

manageprofile

4 posts, 0 answered
  1. siby
    siby avatar
    48 posts
    Registered:
    21 Feb 2009
    01 Sep 2010
    Link to this post
    hi through manage profile editing current user profile.

    How to list the profile details for a particular user.

     if (Request.QueryString["username"] != null)
                {
                    UserManager mgr = new UserManager("Sitefinity");
                    MembershipUser user = mgr.GetUser(Request.QueryString["username"].ToString());
                   
                    if (user != null)
                    {
                        ((ITextControl)UserName).Text = user.UserName;
                        Email.Text = user.Email;                    
                        manageProfile.Mode = ManageProfile.Modes.Edit;
                        manageProfile.Username = user.UserName; 
                    }
                }



    Then the "manageProfile" is not showing up any details.But 
    "MembershipUser user = UserManager.Default.GetUser();" lists the associated fields in the "manageProfile" control.

    Is there any API through which can access the user details. Please reply soon. its quite an urgent.

    Thanking you,

    Siby Chacko
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    01 Sep 2010
    Link to this post
    Hi siby,

    ManageProfile control is used  for getting/setting profile data.
    SetProfileProperties - set all properties that you pass to the current user, but there is no public method that allows you to get all user details. You can override ManageProfile and implement a custom method in it that gets all properties

    sample

    SettingsContext sc = new SettingsContext();
    sc.Add("UserName", this.Username);
     
    SettingsPropertyValueCollection properties = this.Profile.GetPropertyValues(sc, ProfileBase.Properties);
    foreach (SettingsPropertyValue property in properties)
    {
     
    }




    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. siby
    siby avatar
    48 posts
    Registered:
    21 Feb 2009
    01 Sep 2010
    Link to this post
    Hi am getting the following error on trying to use the code. When I tried


      'ProfileCommon' does not contain a definition for 'GetPropertyValues' and no extension method 'GetPropertyValues' accepting a first argument of type 'ProfileCommon' could be found (are you missing a using directive or an assembly reference?) 

      The name 'ProfileBase' does not exist in the current context 


    On accessing the code am getting

     "this.Profile.GetPropertyValue"

    instead of

    "this.Profile.GetPropertyValues" (an 's')

    and the parameters are diff. Is any other namespace need  to be included.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    01 Sep 2010
    Link to this post
    Hello siby,

    I suggest that you should take a look at MSDN about ProfileBase and ProfileCommon classes and how to use them. GetPropertyValues is a method of ProfileProvider.

    ManageProfile p;
    p.Profile.GetPropertyValues


    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered