12.1. Introducing Web Parts

To make it easier to retain the page customization settings that your end users apply to your page, Microsoft includes Web Parts in ASP.NET. Web Parts, as components of the larger Portal Framework, provide an outstanding way to build a modular Web site that can be customized with dynamically reapplied settings on a per user basis. Web Parts are objects in the Portal Framework, which the end user can open, close, minimize, maximize, or move from one part of the page to another.

The Portal Framework enables you to build pages that contain multiple Web Parts, which are part of the ASP.NET server control framework and are used like any other ASP.NET server controls. This means that you can also extend Web Parts if necessary.

The components of the Portal Framework provide the means to build a truly dynamic Web site, whether that site is a traditional Internet site, an intranet site, a browser-based application, or any other typical portal.

When you first look at Web Parts in ASP.NET 3.5, it may remind you of Microsoft's SharePoint offering. Be forewarned, however, that these two technologies are not the same. Web Parts, and the resulting Portal Framework, besides being offered in ASP.NET, are also used by the Windows SharePoint Services (WSS). Microsoft, as it often does, is simply creating a technology that can be used by other Microsoft offerings. In this process, Microsoft is trying to reach the Holy Grail of computing — code reuse!

The modular and customizable sites that you can build with the Portal Framework enable you to place the Web page in view into several possible modes for the end user. The following list describes the available modes and what each means to the end user viewing the page:

  • Browse mode: Puts the page in a normal state, which means that the end user cannot edit or move sections of the page. This is the mode used for standard page viewing.

  • Edit mode: Enables end users to select particular sections on the page for editing. The selected section allows all types of editing capabilities from changing the part's title, changing the part's color, or even setting custom properties — such as allowing the end user to specify his zip code to pull up a customized weather report.

  • Design mode: Enables end users to rearrange the order of the page's modular components. The end user can bring items higher or lower within a zone, delete items from a zone, or move items from one page zone to another.

  • Catalog mode: Displays a list of available sections (Web Parts) that can be placed in the page. Catalog mode also allows the end user to select in which zone on the page the items should appear.

Figure 12-1 shows a screenshot of a sample portal utilizing the Portal Framework with the Edit mode enabled.

Figure 12-1. Figure 12-1

The Portal Framework is a comprehensive and well-thought-out framework that enables you to incorporate everything you would normally include in your ASP.NET applications. You can apply security using either Windows Authentication or Forms Authentication, just as you can with a standard ASP.NET page. This framework also enables you to leverage the other aspects of ASP.NET 3.5, such as applying role management, personalization, and membership features to any portal that you build.

Before getting into working with Web Parts and ASP.NET AJAX together, this chapter starts with a page that makes use of the Portal Framework without AJAX to see how it behaves.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset