Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Enable to get the contact informations

  Asked By: Virgil Herring         Date: Dec 03, 2009      Category: Sharepoint      Views: 195

I developped a web part in C#. I would like to get the contact name
(email will be the best) of an area under sharepoint (web site).

I can have the proprieties of the website (like the tittle of the
website or the description) but I can have the contact.

I search for 2 days on this problem taht I can't solve.

Did you have a solution?

I know that for somebody it will be simply but I'm completely block.

Tagged:            

 

1 Answer Found

 
Answer #1       Answered By: Bhavi Chauhan          Answered On: Dec 03, 2009       

Is this an SPS Area or a WSS site? If it's an Area, then here's an example:

TopologyManager topologyManager = new TopologyManager();
Uri uri = new Uri("http://MyPortal");
PortalSiteCollection sites = topologyManager.PortalSites;
PortalContext portalContext = PortalApplication.GetContext(sites[uri]);
Guid homeGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Home);
Area homeArea = AreaManager.GetArea(portalContext, homeGuid);
string emailAddress = homeArea.OwnerEmail;

If this is a WSS site:

SPWeb mySite = SPControl.GetContextWeb(Context);
string emailAddress = mySite.Author.Email;

 
Didn't find what you were looking for? Find more on Enable to get the contact informations Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].