How do you access a user's Profile from a VB Project???
- From: "Burak Gunay" <burak30@xxxxxxx>
- Date: 1 Feb 2007 06:12:22 -0800
Hello,
In order to access a user's profile in a web code behind funciton,
you'd say
Profile.GetProfile(username)
But you cant do this in a VB project that's part of a web solution.
Here is my code to get and update user's profile in a VB project .
Dim newUserDetails As UserDetails
' create new user details object
newUserDetails = New UserDetails
newUserDetails.name = "john" etc..
' create a new profile with the new user name
Dim newProf As ProfileBase = ProfileBase.Create(userName)
' assign values to the new profile
newProf.SetPropertyValue(ProfilePropertyKey, newUserDetails)
newProf.Save()
The problem is I'm recreating the profile every time.
Instead of this, how can I get the user's profile by username and then
update it? I should be able to update only certain fields in the
profile and not all of them right?
I wrote this
Dim prof As ProfileInfo =
ProfileManager.FindProfilesByUserName(ProfileAuthenticationOption.All,
userName).Item(userName)
but I don't know if I am on the right track.
Your help is appreciated.
Thanks,
Burak
.
- Next by Date: Re: Any chance to differ local group or domain group from windowsIdentity groups?
- Next by thread: Re: Any chance to differ local group or domain group from windowsIdentity groups?
- Index(es):
Relevant Pages
|
Loading