O'Reilly logo

Professional SharePoint® 2007 Development by Tom Rizzo, Adam Buenz, J. Dan Attis, Matt Ranlett, Brendon Schwartz, Eli Robillard, Jeff Julian, John Alexander, John Holliday

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A.7. Using VSeWSS to Build Web Parts

The VSeWSS Web Part Wizard enables you to quickly create SharePoint Web Parts that can inherit from the SharePoint WebPart base class or the ASP.NET 2.0 WebPart base class. It also offers quick deployment of Web Parts using a SharePoint feature manifest built into the embedded SharePoint Solution deployment.

There are several major tasks that are automated by using the SharePoint WebPart template:

  1. Conventional reference establishment and base class inheritance.

  2. Auto-packaging Web Parts into SharePoint solution files for deployment ease (easily the most useful feature).

  3. Temporary key provisioning to sign assembly with a strong name (Temporary.snk), for Web Part deployment into the Global Assembly Cache (GAC) if Code Access Security (CAS) isn't a large concern. This key should be replaced by the enterprise key, which is password protected once the Web Part is pushed to production.

  4. A generic render method to output embedded (child) HTML using HtmlTextWriter, since it allows a granular level of the child control output.

There are very specific references established for some very concrete purposes by using the WebPart project template. The first and most obvious are the SharePoint specific references, since they are required to work with the SharePoint object model. For example, there will be references made to the Microsoft.SharePoint DLL because Web Parts may need site objects (SPSite), web objects (SPWeb), and user (SPUser) objects. Microsoft.SharePoint.Webcontrols ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required