Download presentation
Presentation is loading. Please wait.
1
Matt Gibbs ASP.NET Development Manager
ASP.NET 2.0 Web Parts Matt Gibbs ASP.NET Development Manager
2
Why Web Parts Technology for building portal-type sites
Foundation for Sharepoint 3.0 For The Site User: Customizable layout Personalized view For The Developer: Personalization infrastructure Extensibility Composable UI For The Administator Flexibility and Control Add Web Parts to Site Over Time
3
What are Web Parts
4
Web Parts Basics WebPart WebPartZone WebPartManager
UI element with customizable portal behaviors WebPartZone Region to contain and layout groups of Web Parts Renders elements common to individual Web Parts WebPartManager Required for a WebParts page Manages Display Mode: Browse, Design, Edit, Catalog, Connection Manages WebPart State: Add, Close, Delete, Move
5
Browsing a Web Parts Site
demo Browsing a Web Parts Site
6
Creating A Web Part Options: Benefit from common UI “look and feel”
Any ASP.NET Server control Any User Control Any custom WebControl Any custom control derived from WebPartBase Benefit from common UI “look and feel” Become personalizable
7
demo Create Web Parts
8
Web Part UI Elements Web Part’s UI elements Verbs
UI elements that enable users to perform actions WebPartZone provides standard verbs Close, Minimize, Restore, Help, Edit, Connect, Export WebPart developer can add custom verbs TitleIcon Title Verbs Content Chrome
9
Customizing Web Part UI
Derive from WebPart base class Override properties AllowClose, AllowMinimize, DisplayTitle, … Implement Interfaces IWebPart Title, Substitle, TitleUrl, Description, CatalogIconImageUrl, TitleIconImageUrl IWebActionable Verbs
10
demo Customize Web Parts UI
11
Web Part Catalogs Declarative Catalog Part Page Catalog Part
Statically defined set of available parts Page Catalog Part Closed parts Import Catalog Part Move parts and shared data between servers Programmatically add/delete Web Parts WebPartManager.AddWebPart(webPart,zone,zoneIndex) WebPartManager.DeleteWebPart(WebPart webPart)
12
Web Zones and Display Mode
Web Part Zones are always displayed Others shown according to Display Mode CatalogZone in Catalog Display Mode ConnectionZone in Connection Display Mode EditorZone in Edit Display Mode Design Mode allows moving parts between and within zones
13
demo Create A Catalog
14
Web Parts Personalization
Persists and Retrieves property values Shared User Data Per User Data Attributes define Personalizable Properties [Personalizable], [WebBrowsable] [WebDescription], [WebDisplayName] Data saved per user per page
15
Core Concepts Personalization
<configuration> <system.web> <webParts> <personalization> <authorization> <deny users="*" verbs="enterSharedScope"/> <allow users="*" verbs="modifyState" /> </authorization> </personalization> </webParts> </system.web> </configuration> Configuration Files Web.config or Machine.config.
16
Web Parts Editor Personalize Web Parts using Editor Parts in the Editor Zone AppearanceEditorPart BehaviorEditorPart LayoutEditorPart PropertyGridEditorPart
17
Make Web Parts Personalizable
demo Make Web Parts Personalizable
18
Web Part Connections Wire up multiple Web Parts
Provider and Consumer model Dynamic and Static Connections Define the callbacks for exchanging data
19
Summary Browse Design Edit Catalog Connection
20
Questions
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.