WebParts in asp.net

WebParts are used to personalize a webpage.using WebParts a user can personalize the webpage as required .A user can remove or close the unwanted contents of a webpage.

Whenever changes are made on a webpage those changes are recorded in the database and next time when the user visits the webpage the information is extracted from the database table and the personalized page will appear as it was sated earlier.

Authentication is required to implement WebParts. If windows authentication is used the windows login name is used for authentication. If forms authentication is used the login should be provided by the user from login.aspx page.

WebParts consists of 4 different zones.

  1. WebPart zone(Display part)
  2. Editor Zone
  3. Catlog zone
  4. Connection zone

1. WebPart zone is used to provide the appearance on the webpage.It consists of WebParts,a WebPart zone consists of one or more WebParts through which information is displayed.

2. It is used to editing the properties of WebParts.

3. It is used to add the WebParts-in-Asp-Net at runtime or close existing WebParts.

4. It is used to establish the connection between different WebParts-in-Asp-Net.

WebPartManager: It is a class which manages or controls all the zones.

Note:

WebPart zone consists of WebParts, Every server control when created in a WebPart zone becomes a WebPart.

  • Any server control can be implemented as a WebPart.
  • Html controls cannot be used as WebParts.

WebParts cannot be implemented for authenticated users or anonymous users even though any user access the webpage personalize option will not be available.

Catlog Zone Consists 2 Parts:

  • Declarative catlog part: It is used to add the WebParts at runtime.
  • Page catlog Part: It consists of all the closed WebParts which can be added later on.

Catlog zone will appear only when catlog display mode is activated.

Editor Zone Consists 2 Parts:

  • Appearance editor Part: It is used to set the properties of WebParts.
  • Layout editor Part : Is used to move the WebParts when the browser doesn't supports drag and drop.