Working with Web Parts in SharePoint

  • August 6, 2009
  • By Joydip Kanjilal
  • More Articles »

Web Parts are server controls that can be used to both customize and personalize your site's pages. They can add custom functionality and make your site unique; however, you can't build a custom Web Part directly in SharePoint. To create customized Web Parts, you need either a separate SharePoint designer tool or Visual Studio and ASP.NET. This article explains how to develop custom Web Parts and then deploy them to SharePoint.

Prerequisites

To work through the example in this article, you should have the following items installed:

  1. Microsoft Visual Studio 2005, 2008, or higher
  2. Windows SharePoint Services 3.0
  3. SmartTemplates for Visual Studio

What Are Web Parts?

Web Parts are the basic building blocks of SharePoint Web Part pages. Web Part Pages are actually special pages where you can house a Web Part. Note that a Web Part Page can contain one or more Web Parts. You can add Web Parts to areas called Web Part zones inside a Web Part page.

Each Web Part should contain a modular unit of information. Functionally, Web Parts let you present information in an organized, meaningful, convenient, and consistent manner.

What’s Inside?

A typical Web Part contains three main parts:

  1. A title bar that holds the Web Part's title or heading
  2. A menu that you can use to minimize or close the Web Part
  3. The content or body that displays information

Basic Features

By default, Web Parts support several basic features, including:

  • Drag-and-drop
  • Minimize, restore, and close operations
  • Simple navigation and a consistent UI
  • Support for customization and personalization

Display Modes

A Web Part can have one of the following display modes:

  • BrowseDisplayMode: This is the default display mode.
  • DesignDisplayMode: This display mode is used to change the layout of Web pages that contain Web Part controls.
  • EditDisplayMode: This display mode is used to allow the end users of the Web Part to edit server controls.
  • ConnectDisplayMode: This is used to manage connectivity among Web Part controls.
  • CatalogDisplayMode: This display mode is used to add controls from a catalog of controls.

Types of Web Parts

Windows SharePoint Services contains some default Web Part types, such as:

  • Default Web Parts: These are available by default in any site you create.
  • Preconfigured Web Parts: These are built into the WSS team site template and are available for you to use whenever you create a new team site.

You can also build and deploy custom Web Parts, as shown in the rest of this article.

123


Networking Solutions







Partners