Tuesday, December 05, 2006

Notes on ASP.NET 2.0 CSS Friendly Control Adapter

A control adapter is an optional class that, if present and properly configured, is used to render the Web control instead of using the control's default rendering logic. In short, using control adapters you can take the core functionality of a Web control, but completely customize the markup emitted.

This set of free control adapters, released by Microsoft, provide a set of control adapters that render a variety of built-in ASP.NET controls using preferred CSS techniques.

Moreover, the CSS control adapters ignore any control-level style settings that would get rendered as inline style elements in the rendered markup and instead require that style information be separated out and specified via CSS classes.

While these could be created from scratch, Microsoft has provided the ASP.NET 2.0 CSS Friendly Control Adapters that can be downloaded and plugged into your ASP.NET web applications with minimal effort. Once installed, the control adapters will no longer render inline style attributes (you need to use CSS classes) and replaces the

layouts of the Menu, TreeView, and other controls with CSS techniques.

The presentation settings for these classes can be specified in the page's style element or, ideally, in a separate CSS file.

Indeed, you can modify any ASP.NET control so it produces exactly the HTML you want.

I think Microsoft will build the CSS features into ASP.NET 3.0 as an essence. We won't use inline style anymore, neither table tags for layout, at least I won't. :-)
Actually, I really do not care about what kind of code is beneith the screen/page, I only require it works well as I and users expected. CSS or inline style, table or div, I don't give a fuck. As we get the better one freely and effortlessly, why not better. ;-) That's it.