Developing An Advanced ASP.NET Server Control With Rich
Download
Report
Transcript Developing An Advanced ASP.NET Server Control With Rich
Developing An Advanced ASP.NET
Server Control With Rich Design-Time
Eilon Lipton
PRS401
Software Design Engineer
Microsoft Corporation
Developing ASP.NET 2.0 Server Controls
Agenda
Scenario
Real estate company web site requires rich controls to
enable a variety of custom scenarios
Solution
PhotoViewer: Allows a user to navigate through a
collection of photos for a given listing
MultiList: Allows a user to view real estate listings in a
geographical region
We will cover
Runtime: Composition, state management, callbacks,
web resources, script handling, and data
bound controls
Design-time: Region-editing, task-based editing,
painting, host services
Photoviewer
Runtime: Callbacks And Web Resources
Scenario
Child control will handle rendering
Manage state in parent control
Eliminate page flicker, update only relevant markup
Deploy control as single assembly
Solution
StateManagedCollection simplifies state management for collection
items
Callbacks transfer data between client and server using XMLHTTP
and JavaScript
RaiseCallbackEvent
GetCallbackResult
Web Server
Client
Embedded WebResources used to ease deployment and versioning
Photoviewer Runtime
Eilon Lipton
Software Designer Engineer
Web Platform and Tools
Photoviewer
Controldesigner: Regions And Smart Tags
Scenario
Enhanced design-time interactivity
Promote important editing operations
Solution
CompositeControlDesigner handles interaction with
runtime control
Web resources are handled by the designer host
DesignerRegions describe clickable, selectable,
and editable areas
Mouse click responds to user input
Smart Tags expose important and complex tasks
Photoviewer Design-Time
Eilon Lipton
Software Designer Engineer
Web Platform and Tools
MultiList
Runtime
Scenario
Data and templates define composition
Control must function when ViewState is disabled
Solution
Extend CompositeDataBoundControl to handle
creation of child controls based on data
Use templates to allow user to customize rendering
Store critical state in ControlState rather than
ViewState
MultiList Runtime
Eilon Lipton
Software Designer Engineer
Web Platform and Tools
MultiList
Design-time
Scenario
WYSIWYG template editing
Use standard interfaces for wiring up to a data source
Solution
Extend DataBoundControlDesigner to offer data
source picker and expose schema
DesignerRegions provide custom inline editing of
template content
Paint graphics to go beyond HTML
MultiList Design-Time
Eilon Lipton
Software Designer Engineer
Web Platform and Tools
Summary
Runtime
Composite controls and templates for scenario
controls
DataBoundControl class for data-driven content
WebResources for embedded content
ControlState for critical state
Design-time
DesignerActionLists for contextual tasks
DesignerRegions for contextual editing
Clicking and painting for interactive page design
Auto format for common control styles
Call To Action
ASP.net 2.0 adds many new features for
the control developer
Control
WebControl
DataBoundControl
CompositeControl
CompositeDataBoundControl
MultiList
MultiListViewSwitcher
PhotoViewer
Community Resources
At PDC
For more information, go see
PRS312 – ASP.NET: Future Directions for Developing Rich
Web Applications with Atlas (Part 1)
PRS420 – ASP.NET: Future Directions for Developing Rich
Web Applications with Atlas (Part 2)
After PDC
If you missed this session, watch it on the DVD
PRS401: ASP.NET: Developing an Advanced ASP.NET
Server Control with Rich Design-Time
ASP.NET Web Site – http://www.asp.net
ASP.NET Forums –
http://forums.asp.net/142/ShowForum.aspx
Questions?
[email protected]
© 2005 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.