New Introduction to ASP.NET 2.0 Web Parts Framework

New Introduction to ASP.NET 2.0 Web Parts Framework

Posted by: Paul Ballard on October 15, 2004 @ 01:37 AM

URL: http://www.theserverside.net/news/thread.tss?thread_id=29465

 

MSDN has released a new paper that highlights the features of the ASP.NET 2.0 Web Parts Framework. Formerly restricted to SharePoint sites, Web Parts are the building blocks for an easily customizable web interface and are becoming fully supported features of ASP.NET 2.0. The new Web Part Framework includes features for personalization, communication between Web Parts, and creating custom menus.

Web Parts are similar to web user controls but provide the functionality to allow users to customize the website by adding, deleting, and moving controls around the page based on WebPartZones. Any ASP.NET server control can act as a Web Part but by creating a custom control derived from the WebPart class you gain access to advanced features.

One of those features is personalization. Personalization allows a user to make modifications to a part’s properties that are then stored in the database. When the user returns to the site, the changes are applied. This feature is enabled with a simple [Personalizable()] attribute.

Communication between parts is also an important feature of the Web Parts Framework. Previously, this was a rather complicated process but now it’s considerably easier.

There are four steps that you must complete to create a static connection between two Web Parts:

1. You must define an interface specifying the methods and properties that are shared between the connected Web Parts.

2. You must add the ConnectionProvider attribute to the Web Part used to provide the shared information.

3. You must add the ConnectionConsumer attribute to the Web Part used to consume the shared information.

4. You must declare the connections within the StaticConnections sub tag of the WebPartManager class.

Modifying Web Part properties is easier for users by adding custom menu options to your Web Part. This is done by overriding the Verbs property and adding new WebPartVerbs.

注:

1,目前只有SPS支持Web Parts,当然开发平台还是VS.Net IDE

2,未来SPS版本(SPS 2003以后的版本)将会基于WebParts of ASP.NET 2.0(来自comments, not official)。

 

Reference:

1, http://www.theserverside.net/news/thread.tss?thread_id=29465
2, Meet the Web Part Framework, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-meetwebpartfrmwrk.asp

你可能感兴趣的:(framework)