SharePoint Web Part Code Snippets for VS 2005
When you want to develop web parts for SharePoint the “traditional” way, it’s good idea to use the Web Part Templates for Visual Studio .NET. These templates will give you a start class to quickly build web parts. Unfortunately these templates are not (yet?) available for Visual Studio 2005. Since Windows SharePoint Services SP2 you can run your WSS sites on .NET 2.0, so you can build your SharePoint web parts with Visual Studio 2005. Given that copy/pasting code is rather cumbersome I’ve create a couple of code snippets for Visual Studio 2005 that will generate code for a SharePoint Web Part. Currently I’ve got code snippets to create:
- C# Web Part (shortcut wp)
- C# Web Part Property (shortcut wpprop)
- C# Tool Part (shortcut tp)
I’m still working on the other items (provider and consumer web part) and the VB.NET versions (any volunteers?). You can download them from the GotDotNet site (http://workspaces.gotdotnet.com/webpartcodesnippets), the ZIP contains a VSI package so you can easily install them in VS 2005. (Make sure you select the code snippets you want to install, see screenshot)