How can you access or create a list on a My Site host (i.e. a custom WebPart on main.example.com accessing information that is hosted on my.example.com)? I want to have a store for user settings that can be shared between sites/applications (could be a list of links, or favourites, widget settings etc). If the site doesn't already exist for the user (e.g. my.example.com/personal/username) then how can you create it through code alone (rather than them using the 'my content' link in My Site to create it)?

Another example of functionality I want to build is the ability for the user to access items they have tagged, to show in a popup or dropdown (probably grouped under the content type) when they click 'tags and notes' (instead of going to My Site > Tags and Notes).

| improve this question | | | | |
  • Did you ever find a solution for this question? Maybe you could add it below. – Kit Menke Jul 15 '11 at 19:04

You can call CreatePersonalSite off the Profile. See: MSDN Documentation

public void CreatePersonalSiteSample()
  //get current service context
  SPServiceContext serviceContext = SPServiceContext.Current;

  //initialize user profile config manager object
  UserProfileManager upm = new UserProfileManager(serviceContext);
  string sAccount = "mydomain\\myalias";
  UserProfile u = upm.GetUserProfile(sAccount);
  SPSite mysite = u.PersonalSite;
  string myurl = u.PersonalUrl;

For Social Tags you can use the SocialTagManager.GetTags method. http://msdn.microsoft.com/en-us/library/microsoft.office.server.socialdata.socialtagmanager.gettags.aspx

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.