Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

First of all, I'm pretty new to SharePoint so don't shoot me if this is a noobish question or if I don't provide all the right information at once... :)

I have a team-site in SharePoint with following URL: "http://myServer/Opdracht_Ben/". By going to this URL I'm redirected to following page: "http://myServer/sites/Opdracht_Ben/SitePages/Home.aspx".

In Visual Studio I have a project for this site with a feature. When this site-feature is activated it should change the content of the home-page to some custom tekst and layout (i.e.: HTML). The content is not contained within a web part or the page is not a WikiPage, just text on a page.

I've been looking on MSDN and on several tech-sites and blogs but I have not found anything that could help me further. Does anyone know how I can 'reach' the content of the page and modify/update it?

PS: On StackOverflow I have found a related question (Click for the question), but the provided solution is for when the web is a "Publishing Web", which is not the case here, so that solution won't do me any good.

Thanks in advance!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I don't have a working solution to post but I'm pretty sure that you would need to get hold of the page via the object model, find its LimitedWebPartManager then iterate through the .WebParts until you found the one for the content. From there, you would probably have to cast the web part from the generic WebPartDefinition to the specific type (a .GetType() will help you identify the exact type but I suspect you are looking for a ContentEditorWebPart). Once you have the specific web part, there should be a property available like .Content that can be changed.

Just remember to update the page after you make the changes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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