Expand|Select|Wrap|Line Numbers
- String _AccountName = Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.LoginName;
Error: UserProfile userProfile = profileManager.GetUserProfile(_AccountName);
Error: UserProfile userProfile = profileManager.GetUserProfile("_AccountName");
Error: UserProfile userProfile = profileManager.GetUserProfile("Doamin\UserName");//[Hardcoded UserLogin Name]
Success: UserProfile userProfile = profileManager.GetUserProfile("Domain\\UserName");
because single '\' wont take.
Now I have to retrive Account Name and assign in
Expand|Select|Wrap|Line Numbers
- UserProfile userProfile = profileManager.GetUserProfile(?)
Expand|Select|Wrap|Line Numbers
- string[] userDomainName=_AccountName.Split('\\');
- string domain = userDomainName[0];
- string Name = userDomainName[1];
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- sb.Append(domain);
- sb.Apend("\\");
- sb.Append("\\");
- sb.Append(Name);
- string DomainUserName = sb.ToString();
Error: UserProfile userProfile = profileManager.GetUserProfile(DomainUserName);
Please help me.