Archives
-
Tip/Trick: Use the ASP.NET 2.0 CSS Control Adapters for CSS friendly HTML output
Tired of having html <table> elements rendered by the built-in ASP.NET server controls and wishing you could use a pure CSS solution instead? If so, read on...
Last week we released Version 1.0 of the ASP.NET 2.0 CSS Control Adapters. These adapters take advantage of a new extensibility feature in ASP.NET 2.0 that we call the "Control Adapter Architecture", and which enables developers to override, modify and/or tweak the rendering output logic of an existing server control (without changing any of its properties, supported events, or programming model).
The ASP.NET 2.0 CSS Control Adapters that we released last week provide pre-built control adapters for 11 of the most common ASP.NET controls (GridView, DetailsView, FormsView, DataList, Menu, TreeView, Login, LoginStatus, CreateUserWizard, ChangePassword and PasswordRecovery). The CSS Control Adapters cause these ASP.NET controls to emit CSS friendly html output (eliminating things like inline styles and <table> elements), and can significantly help when using CSS on your web-site.
Click any of the links below to see a before/after example of how they change the markup generated by these built-in ASP.NET controls:
- Menu
- TreeView
- DetailsView
- FormView
- GridView
- DataList
- Login
- ChangePassword
- PasswordRecovery
- CreateUserWizard
- LoginStatus
The CSS Control Adapter toolkit includes both VB and C# source code for all of the above control adapters. You can use the source-code as-is (without having to modify anything) to get pure CSS output. Or if you want to tweak the output even further you can go in and modify the adapters to emit any custom markup you want:
I posted a nice tutorial two months ago that walksthrough how you can use the CSS Control Adapters that I highly recommend reading to learn how to get started.
Scott Mitchell earlier today also posted a nice CSS Control Adapters article on www.4guysfromrolla.com that covers how to use them as well.
You can ask questions and get help on how to use them on the CSS Control Adapters Forum on http://www.asp.net.
Hope this helps,
Scott
P.S. I'd like to pass along a special big thanks to Russ and Heidi for all of their awesome work in building these CSS Control Adapters and samples!
P.P.S. For additional ASP.NET Tips/Tricks blog posts of mine, please review my ASP.NET Tips, Tricks and Resources page.
-
Extending the ASP.NET 2.0 Localization Model with a Database Resource Provider
-
Tip/Trick: Implement "Donut Caching" with the ASP.NET 2.0 Output Cache Substitution Feature
Some Background:
-
Tip/Trick: How to Register User Controls and Custom Controls in Web.config
I've been including this technique in my ASP.NET Tips/Tricks talks the last year, but given how many people are always surprised by its existence I thought it was worth a dedicated tip/trick post to raise the visibility of it (click here to read other posts in my ASP.NET Tips/Tricks series).
-
Common Gotcha: Don't forget to <clear/> when adding providers
Recently I've helped a few people out who were having an issue with how they had added new Membership, Role, and Profile providers within their web.config file. If you are ever going to add a provider declaration within your web.config file, please read-on to learn how to avoid a common gotcha.
-
Podcasts and Prototyping
Ron Jacobs recently published a podcast with me for his ARCast.net show (which is a free Podcast series aimed at architects). In the podcast we covered a couple of topics people might find interesting:
-
IronPython for ASP.NET CTP
A few months back I blogged about the release of IronPython v1.0. IronPython is an implementation of the Python dynamic language for .NET. It supports an interactive console with full dynamic compilation support and makes all .NET libraries easily available to Python programmers -- while still maintaining full compatibility with the Python language.
-
Gotcha: Lost HTML Intellisense within ASP.NET AJAX Controls
Symptom:
-
Nikhil's WebDevHelper Utility and ASP.NET AJAX Support
If you aren't subscribed yet to Nikhil's blog, you really should visit it and subscribe immediately.
-
Office 2007, VS 2005 Tools for Office, and VS 2005 Extensions for SharePoint
Last week Microsoft released Office 2007. For those of you who haven't tried it yet, this is probably the biggest release of Office since Office 95 and is a really awesome upgrade. Among its biggest innovations is the introduction of the new "Ribbon UI" paradigm - which provides a significantly new and improved user experience (menus are no longer used):
-
ASP.NET Connections Slides + Demos
Earlier this week I presented at the ASP.NET Connections conference in Las Vegas. This is a great conference that is held twice a year (the fall show is in Las Vegas, the spring show is in Orlando). This past week we had over 1,500 attendees for the ASP.NET conference alone, and more than 4,700 total for all of the DevConnections conferences held in parallel (VS, SQL, SharePoint, Mobile and Office Connections are all held in the same place - with attendees allowed to attend any session).
-
ASP.NET AJAX 1.0 Beta 2 Release
On Monday we shipped the Beta2 release of ASP.NET AJAX (aka "Atlas"). You can learn more about it on the http://ajax.asp.net web-site and download it here.
-
Windows Vista Ships with .NET FX 3.0 and IIS7 Built-in
As you might have already heard, earlier today Microsoft released to manufacturing (aka RTM'd) Windows Vista. This is a huge milestone, and the product contains a ton of great features and value. I've been running it as my only operating system since July, and have been really impressed the last few months (I haven't had a single crash or issue with it since RC1 - despite using it heavily 12+ hours every day).
-
Tips/Tricks and LINQ Slides+Demos from my Talk in Dallas
I had a great time presenting for a few hours to the North Dallas .NET User Group this past Thursday. I covered two topics:
-
PHP and the FastCGI Module for IIS 7.0
I've blogged several times in the past about how cool IIS 7.0 is. Many of my posts have highlighted some of the rich new ASP.NET and .NET developer opportunities it brings (integrated pipeline, unified web.config configuration, integrated admin tool experience, etc). It is really going to open up huge developer opportunities and provide an immensely customizable web-server for people to use.