Version informationThis version was last updated on 20 November 2006. If you downloaded the original version on 4/27/2006 (Beta 1) please update your bits immediately. Download the sourceIntroductionWelcome! ASP.NET is a great technology for building web sites but it would be even better if it provided more flexibility for customizing the rendered HTML. For example, the Menu control makes it simple to add a menu to a web site, but it would be better if it didn't create <table> tags and was easier to style using CSS. Happily, it's easy to customize and adapt the Menu control to generate better HTML. Indeed, you can modify any ASP.NET control so it produces exactly the HTML you want. The key is to use something that may be new to you: control adapters. These are little chunks of logic that you add to your web site to effectively "adapt" an ASP.NET control to render the HTML you prefer. The ASP.NET 2.0 CSS Friendly Control Adapters kit provides pre-built control adapters that you can easily use to generate CSS friendly markup from some of the more commonly used ASP.NET controls. Getting StartedBefore trying to learn how control adapters work, it's helpful to see them in action. Use the Examples menu at the top of this page to see the impact of adapting some of the ASP.NET controls. Each example page lets you enable/disable the adapters so you can immediately see their impact. Likewise, you can dynamically change themes, swapping in a different set of CSS files without changing the HTML markup. A source code viewer lets you study how each sample is constructed. These sample control adapters demonstrate how to build an ASP.NET web site that is particularly easy to style with CSS. Feel free to use, copy, clone and modify the markup, CSS and code that you find here. To experiment with a local copy of this web site:
|
|
来自: thy > 《urlrewrite》