Follow in Twitter & Facebook

Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools

Wednesday, October 24, 2012

Web Parts in ASP.NET ?

Web Parts, part of the 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 the part of the ASP.NET server control frame work and are used like any other ASP.NET server controls.

When you first look at the web parts in ASP.NET 2.0, it may remind you of Microsoft's share point offerings. however 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 singular technologies that can be used by other Microsoft offerings.
The modular and customizable sites that can be build with the new portal framework enable you to place the web page in view into several possible modes for the end user. The following list describes each of these available modes and what each means to the end user viewing the page.

Normal Mode:
Puts the page in a normal state, which means that the end user can not  edit or move sections of the page.This is mode used for standard page viewing.

Edit Mode:
Enables end users to select the particular sections on the page for editing. The selected section allows all types of editing capabilities from changing the part's title,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 the end users to rearrange the order of the page's modular components. The end user can bring items higher or lower with in 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.

THe Webpartmanager control is an ASP.NET server control that completely manages the state of the zones and the content placed in these zones on a pre user basis.This control, which has no visual aspect, can add and delete items contained with in each zone of the page . The webpartmanager control can also manage the communications sometimes required between different elements contained in the zones.

The webpartmanager control must be in place on every pagein your application that works with the protal framework. A single webpartmanager control doesnot manage an entire application instead it manages on a pre-page basis.

Adding a webpartmanager control to an ASP.NET page

<%@Page Language="C#"%>
<html xmlns = "">
<head runat="server">
<title>web Parts Example</title>
<form id ="form1" runat="server">
<asp:WebPartManager ID="WebPartManager1" runat="server">

If you want to work from design surface of visual studio 2005, you can drag and drop the WebPartManager control from the toolbox to the design surface.

0 on: "Web Parts in ASP.NET ?"