A Developer's First Look at Web Parts (Cont.) Designing Web Parts with Visual Studio.NET You can use Visual Studio .NET to build Web Part assemblies for use in SharePoint products and technologies. There are two options for building your Web Parts in Visual Studio: you can use the standard (provided) template for building a Web Control gallery, or you can use a special template and build a Web Part gallery. The Web Part gallery templates are not included with Visual Studio .NET, but they are downloadable from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnspts/html/sharepoint_webparttemplates.asp | " | Using SharePoint and Web Parts, non-programmers can assemble the information they need and control how they want it displayed.
| " |
The templates are provided to help you create Web Parts and are very similar to the default server control file and project templates included with Visual Studio .NET. These templates are available for both Visual Basic .NET and C#. You choose the language you want when you run the template's setup program (see Figure 6). Another piece of information you need to supply while installing the templates is the location of the Microsoft.SharePoint.dll file (see Figure 7). On a computer running Windows SharePoint Services, the DLL is stored in local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI.  Figure 6: The Web Part Template installer lets you choose a language. Figure 7: The Web Part Template installer requires you to enter the location of the Microsoft.SharePoint.dll.Creating a project from the Web Part gallery templates offers advantages and features over using the standard Web Control gallery template, including: - An automatic reference to the Microsoft.SharePoint.dll file
- A Web Part class file and a matching .dwp file
- A Web Part Manifest.xml file used during installation of the Web Part on the SharePoint server
You will find the process of creating a Web Part very familiar if you have ever created an ASP.NET custom control. All the techniques for building an ASP.NET custom control also apply to building a Web Part custom control. The primary difference is that with a Web Part, you inherit from the WebPart class instead of from a WebControl class. You also need to override the RenderWebPart method instead of overriding the RenderContents method. Additional information regarding developing Web Parts for SharePoint products and technologies is available in the SharePoint Products and Technologies Software Development Kit (SDK) available from MSDN (http://msdn.microsoft.com/sharepoint), and there are additional resources listed in the sidebar. Conclusion Developing Web Parts is definitely not your grandfather's programming. Web Parts mean new opportunities, new horizons, and new challenges for developers providing a revolutionary capability for end users to customize their workspaces. As always, I'm interested to hear your feedback about the material covered here. Jim Duffy | & | | Clint Covington

Lead Program Manager Web Parts SharePoint Products and Technologies Microsoft Corporation SharePoint Products and Technologies are becoming the center point of the knowledge worker's experience. Using Web Parts, ASP.NET developers can extend everything from enterprise portals to team and personal sites by building reusable components that support personalization. End users can dynamically drag and drip these components into their pages and then set properties that control how content is rendered. Part-to-part connections make it possible for one part to pass data to another part through supporting common interfaces. Developers are going to love the power of Web Parts! |