One Brain Man

Thursday, December 22, 2005

 

ASP.NET 2.0 Control Adapter Architecture

One of the topics that seemed to get the most interest was our plan to release some control adapters (with full source) that demonstrate how to build pure-CSS style based rendering implementations for some of the built-in ASP.NET server controls.
The architecture to-do this is pretty cool, and something we baked into ASP.NET 2.0 very early on in the project (early in the release we were planing to build mobile device adapters for all of the standard ASP.NET controls -- although we later backed off of this). What is nice about the architecture is that the renderings can be controlled completely independently of the controls developers program against (so developer used to using the asp:menu control continue to program against that object model -- regardless of whether it is table or css based output).
You can configure an alternative adapter render class for each ASP.NET control separately from your app code (this can be configured using .browser files -- so you can even specify different adapters based on the incoming user-agent). The ASP.NET control architecture then delegates to the adapter when it comes time to render -- and the adapter can handle all output generation (if you want to get even fancier you can override post-back and other life-cycle events with your adapters).
Here are a few links to articles on MSDN about how it works:
Architecture Overview of Adapters
Browser Definition Files
Sample code to a simple adapter in the ASP.NET 2.0 QuickStarts
Hope this helps,

Steve

Comments: Post a Comment



<< Home

Archives

May 2004   April 2005   May 2005   June 2005   July 2005   August 2005   September 2005   October 2005   December 2005   February 2006   July 2006  

This page is powered by Blogger. Isn't yours?

My Photo
Name: