Everything SharePoint and XAML

My continuous learning of SharePoint, XAML, Silverlight, Windows Phone 7, Windows 8, Office, VSTO, C#…

Part 6: Add the Web Part to a SharePoint 2007 Site

Posted by Steve Pietrek on June 6, 2007

This is Part 6 of a series on creating web parts and deploying them to SharePoint using a VS 2005 Solution Project. There are 6 parts in the series.


1. Open your home page of the site where you want to test the new web part
2. Select Site Actions>Site Settings (I am using WSS 3.0). Under MOSS 2007, select Site Actions>Site Settings>Modify All Site Settings
3. On the Site Settings page, select Web Parts under the Galleries heading
4. On the Web Part Gallery, click the New link button
5. Note: I ran into an issue with trust in my early iterations of creating web parts which are deployed to SharePoint. Depending on the web part, you may need to increase the trust level in the web.config. For the web part created in this document, WSS_Minimal may be sufficient. I did create another web part which does data access and WSS_Minimal was not sufficient – had to increase it to WSS_Medium. If necessary, to change the trust level, open the web.config, search for trust level=, and change accordingly. I believe it’s possible to set trust level for web parts on an individual basis and I will look into creating a separate post at a later time to cover this.
6. On the New Web Parts Page, check the box next to the HelloWorld.Web.HelloWorldWebPart web part and click the Populate Gallery button
7. Go to the site page where you want to add the web part
8. Select Site Actions>Edit Page
9. Click the Add a Web Part link in the web part zone you want to add the web part to
10. Under All Web Parts, check the HelloWorldWebPart, and click the Add button

If you do need to make any changes to the web part assembly, just rebuild the assembly and copy it to the bin directory. I typically run an iisreset to make sure my changes are applied. No need to redeploy the solution.

This concludes the series on creating a web part and deploying the web part to SharePoint. In the future, I plan on writing a series on creating a web part using the MVP Pattern and deploying the web part to SharePoint.

Advertisements

Sorry, the comment form is closed at this time.

 
%d bloggers like this: