WebPart Framework basics
CoderSource.net
WebPart Framework basics - Article by deepak.gupta
Level: MediumType: Article
Rating: Page: 1 of 3

Date: 8/17/2007 12:00:00 AM

Environment: IIS, ASP .NET, C# 2.0

ASP .Net Web Parts framework contains a set of controls that help in organizing a portal page in a way that provide users of the portal flexibility to customize the appearance, content, and behavior of its contents directly from a web browser.

The changes made are then saved for the user and recalled for subsequent visits.
Using the Web Part framework , developer can enable end users to:

  • Personalize page content     :-
  • Users can add new Web Parts controls to a page, remove them, hide them, or minimize them like ordinary windows.

  • Personalize page layout      :-
  • Users can drag a Web Parts control to a different zone on a page, or change its appearance, properties, and behavior.

  • Export and import controls :-
  • Users can import or export Web Parts control settings for use in other pages or sites, retaining the properties, appearance, and even the data in the controls.

  • Create connections           :-
  • Users can establish connections between controls

    Why WebPart Framework

    Websites today contain a wealth of information; so much that a poorly designed site can easily overwhelm users. User wants to see the sites that suit their individual working style. User might want to hide the parts that contain information in which they have no interest. To better help users cope, portal websites today need to organize their data into discrete units that support a degree of personalization that allows the properties or state of page’s controls to be saved in long term storage and not tied to a particular browser session, so that user will be able to see the same settings when he revisit the page again.

    To support all the Microsoft comes with ASP .Net Web Part Framework

    The Major Components of the ASP.NET 2.0 WebPart Framework

    A page that is designed to host Web Parts is known as a Web Part Page.

    Layout of WebPart Page:

    Following are the major component of ASP.Net2.0 WebPart Framework

    WebPartManager: This control is the central policeman of the ASP.NET 2.0 WebPart framework. Each page should contain only a single WebPartManager, which is responsible for managing all functionality, events, and customization of various WebParts on that page. It has no user interface and is invisible at runtime. WebPartManager also has the ability to set various modes.

    • BrowseDisplayMode: Represents the default display mode.
    • CatalogDisplayMode : Used for adding controls from a catalog of controls to a Web page.
    • ConnectDisplayMode : Displays a special UI for users to manage connections between Web Part controls.
    • DesignDisplayMode : Used for changing the layout of Web pages containing Web Part controls.
    • EditDisplayMode : Displays a UI from which end users can edit and modify server controls

    Various Zones: Zones are physical areas on a page. These are implemented in the following Server Controls that ship with the Framework:

    WebPartZone: A WebPartZone is a control that defines an area on a page where one or more WebParts can be hosted. A WebPartZone also controls the look and feel of a WebPart inside itself. Also, any control that doesn't inherit from the WebPart class can masquerade itself as a WebPart and live inside a WebPartZone. This is done with the help of the GenericWebPart class, which inherits from the WebPart base class. By doing so, you are restricted to a subset of the functionality that a WebPart class can expose.

    CatalogZone: The CatalogZone is the menu or the catalog from which a user can choose. It holds a number of CatalogPart controls, which in turn hold WebParts that are already added to the site and ready for the picking to add to various pages on the site. The user can pick WebParts from the Catalog, and add them to the various WebPartZones on the same page.

    EditorZone: This is the area on the page that prompts the user to edit his WebPart and customize it to his specific needs. A WebPart can also be customized in a Shared mode, where an administrator can configure the WebPart and all other users can view or use the WebPart but not customize it.

    ConnectionsZone: This is the area of the page that prompts the end user to define communication between various WebParts on the same page.

    Various Parts:

    WebPart: A WebPart is a reusable widget on a Web page. The user can choose to add a WebPart on his page, customize the WebPart per his needs, or even define communication between various WebParts. An ASP.NET 2.0 WebPart inherits from the System.Web.UI.WebControls.WebParts.WebPart class. It Contains the actual content presented to the user.

    CatalogPart: The base class for catalog WebPart controls that present a list of available WebParts to users. Derived classes are ImportCatalogPart, DeclarativeCatalogPart, and PageCatalogPart.

    EditorPart: The base class for all editing controls that allow modifications to WebParts. An editor part presents its own user interface to let users set properties.

    DeclarativeCatalogPart: The DeclarativeCatalogPart control enables you to add a catalog of WebPart or other server controls to a Web page, giving users the ability to change the set of controls and the functionality available on a page at run time. A catalog is a list of WebPart or other server controls that is visible when a page is in catalog-display mode. At design time you can add controls to the DeclarativeCatalogPart control and at run time a user can choose which controls to view in the page by selecting them from the catalog list.

    1 2 3

    You Can Rate this Article, if you are Logged In      
     

    More Links from CoderSource.net:

     
    Refer to a Friend:

    Your Details:

    Name:     e-mail:

    Friend Details:

    Name:    e-mail:    


    MENU
    Home
    MFC 
    C++
    .Net
    WIN32
    Programming
    Forum
    My Articles
    Add to Google
    Add to My Yahoo!
    Welcome to Codersource.Net Login | Register | Faq  

    SEARCH
    Google
     

    NOTES:


    Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

    © Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us