Back in the days of Web Forms, there were server controls, and they generated rather CSS-unfriendly HTML. So, Microsoft got someone (Russ Helfand) to write adapters that changed their rendering to be more CSS-friendly: the “CSS Friendly Control Adapters” were born.
A little less farther back, in 2007, I tried convincing some people at Microsoft to let the community continue development of these adapters, and they agreed. The CSSFriendly CodePlex project was born, and a bunch of bugs and some new features were added.
A lot has changed since then, but the adapters still have use today for people stuck on .Net 2.0 (they’re in the top 200 most downloaded CodePlex projects, and their forums still see activity). To facilitate those who still use CSSFriendly, I’ve added the library package to NuGet.
How to use the CSSFriendly NuGet package
- First, you need Visual Studio 2010 and NuGet. (If you’re new to NuGet, read the getting started documentation.)
- Next, right-click the References folder and choose Add Library Package Reference.
- In the Add Library Package Reference window, search for “cssfriendly.”
- When you see the CSSFriendly package, click the Install button.
After it installs, the following is added to your project:
- The CSSFriendly library reference
- The CSSFriendlyAdapters.browser file in the App_Browsers folder
At that point, you’re ready to go!
The full source of the CSSFriendly library is still available at CodePlex: http://cssfriendly.codeplex.com. Downloads there include sample code and walkthroughs.
Enjoy, and let me know if you have any issues!