CSS Control Adapter Toolkit for ASP.NET 2.0

Tired of having <table> elements rendered by the built-in ASP.NET server controls and wishing you could use a pure CSS solution instead?  Read on...

 

Today we published the CSS Control Adapter Toolkit for ASP.NET.  This toolkit provides information about how the ASP.NET 2.0 Control Adapter Architecture works, as well as a set of 5 sample control adapters (with full source that you can optionally tweak/modify) that provide CSS friendly adapters for 5 of the built-in ASP.NET controls (specifically: Menu, TreeView, DetailsView, FormView and DataList). 

 

You can download this release for free from here, and immediately begin using it in your ASP.NET 2.0 sites today.

 

What does a control adapter let me do?

 

A control adapter allows you to plug-into any ASP.NET server control and override, modify and/or tweak the rendering output logic of that control. 

 

What is cool about control adapters is that they do not require a page developer to program against a new control, or modify the control programming model semantics (you still use the same control properties, methods, events and templates you did before).  Indeed – a page developer can be entirely oblivious that a control adapter is being used (the control adapter model makes it very clean to register and encapsulate this support).

 

The CSS Control Adapter Toolkit includes a bunch of pre-built control adapter samples that show how you can use the control adapter architecture to emit 100% CSS based rendering output (no tables or inline styles – instead use external CSS stylesheets for everything). 

 

[Note: If you want your brain to start exploding in terms of possibilities, you can check out the cool XAML/Avalon control adapters that Plip built that cause ASP.NET controls to output Avalon markup.  You can check it out here]

 

Show me an example of how I use these control adapters?

 

To see a simple example of control adapters being used, you can download this self-encapsulated menu sample I built here. 

 

Note that you do not need to install the CSS Adapter toolkit to run my sample (the CSS Adapter Toolkit mainly includes samples and documentation – you can directly embed adapters into any ASP.NET application and doing so doesn’t require you to install or update any system components). 

 

 

The above menu sample contains a Web.SiteMap file that defines the site navigation structure of an ASP.NET 2.0 Site (note: to learn more about the new ASP.NET 2.0 Site Navigation features read this past post).  It then contains two pages – menu1.aspx and menu2.aspx – that use the standard ASP.NET 2.0 Menu control to databind against the SiteMap.

 

Menu1.aspx shows how to build a horizontal sub-menu navigation system (note: below is all of the code and markup – there is no code needed in the code-behind or on other pages or classes):

 

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Menu1.aspx.cs" Inherits="_Default" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Menu Sample1</title>

    <link href="StyleSheets/Menu.css" rel="stylesheet" type="text/css" />

    <link href="StyleSheets/MenuStyle.css" rel="stylesheet" type="text/css" />

</head>

<body>

    <form id="form1" runat="server">

    <div>

       

        <asp:Menu ID="Menu1"

                  runat="server"

                  Orientation="Horizontal"

                  CssSelectorClass="PrettyMenu"

                  EnableViewState="false"

                  DataSourceID="SiteMapDataSource1">

        </asp:Menu>

   

        <asp:SiteMapDataSource ID="SiteMapDataSource1"

                               ShowStartingNode="false"

                               runat="server" />

    </div>

    </form>

</body>

</html>

 

It renders like this in FireFox:

 

 

Menu2.aspx shows how to build a vertical sub-menu navigation system:

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Menu2.aspx.cs" Inherits="Menu2" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Menu Sample2</title>

    <link href="Stylesheets/MenuStyle.css" rel="stylesheet" type="text/css" />

    <link href="Stylesheets/Menu.css" rel="stylesheet" type="text/css" />

</head>

<body>

    <form id="form1" runat="server">

    <div>

     

        <asp:Menu ID="Menu3"

                  runat="server"

                  CssSelectorClass="PrettyMenu"

                  EnableViewState="false"

                  DataSourceID="SiteMapDataSource1">

        </asp:Menu>

       

        <asp:SiteMapDataSource ID="SiteMapDataSource1"

                               ShowStartingNode="false" runat="server" />

   

    </div>

    </form>

</body>

</html>

 

It renders like this (also using FireFox):

 

 

Because I’ve registered the CSS Menu Adapter for my site, the output from both menu controls are rendered using <ul><li></ul> html elements instead of tables.  I am using two CSS stylesheets within the site to stylize them.  One is a stylesheet called “Menu.css” that comes with the CSS Toolkit and contains the standard “behavioral” rules for menu controls (for example: what elements are blocks vs. inline, etc).  The expectation is that developers don’t change these often.  The second stylesheet is called “MenuStyle.css” and contains the site specific style behavior (colors, fonts, sizes, location, etc).  I can either work on this file directly myself, or pass it off to a designer to use standard CSS styling techniques to customize it. 

 

Click here to see a diagram that is included with the CSS Toolkit Whitepaper to see the default styling rules used with the CSS Menu Adapter. 

 

Note that if you want to customize the rendering even further you can easily tweak the CSS Menu Adapter to modify it however you want (the source for each CSS adapter ships with both VB and C# versions).  Laurent has a good example of how he did that to stylize Site Navigation node selection here.

 

So how does someone create an ASP.NET control adapter from scratch?

 

Creating a control adapter is fairly straight-forward.  Basically you do two things:

 

1) Create a class that derives from the System.Web.UI.Adapters.ControlAdapter base class or one of the built-in sub-classes of it (for example: System.Web.UI.WebControls.Adapters.MenuAdapter or System.Web.UI.WebControls.Adapters.DataBoundControlAdapter).  Within the sub-class, you then override the appropriate methods to customize the markup however you want. 

 

For example, the below code-snippet shows a few snippets from the CSSFriendly.MenuAdapter that ships with the CSS Adapter Toolkit:

 

 

Note how the “BuildItems” method (which is called from the “RenderContents” virtual method) is used to output <ul> elements instead of tables for the Menu output.  Notice also the built-in helper methods that can be used to support indentation and HTML tag rendering.

 

The Control Adapter class that you create can be added into your web project and compiled as part of the project.  Alternatively, for greater re-use you could add it to a class library project and reference it from multiple web-projects (allowing nice re-use and factoring). 

 

2) Once you have created a ControlAdapter class that customizes the output however you want, you register it within your ASP.NET 2.0 Web Application by adding a .browser file within the /App_Browsers sub-directory underneath the application root:

 

 

This .browser file can contain browser capability rules (declared using XML) that allow you to customize whether a control adapter is used – and optionally even configure a separate one for each browser or input device.  For example, if you wanted to only use the above Menu control adapter for Versions 6-9 of IE (but fall back to using tables with IE5), you would register it like so within your .browser file:

 

<browsers>

  <browser refID="IE6to9">

    <controlAdapters>

      <adapter controlType="System.Web.UI.WebControls.Menu"

               adapterType="CSSFriendly.MenuAdapter" />

    </controlAdapters>

  </browser>

 

  <browser refID="MozillaFirefox">

    <controlAdapters>

      <adapter controlType="System.Web.UI.WebControls.Menu"

               adapterType="CSSFriendly.MenuAdapter" />

    </controlAdapters>

  </browser>

 

</browsers>

 

Once you’ve saved the above two rules you are all set.  When an IE 6->9 browser or FireFox browser hits the site now, all Menu controls will render using CSS style-friendly output (specifically <ul><li></ul> elements).  When an IE browser hits the site, the Menu controls will render using tables. 

 

You do not need to modify any page code or code-behind code to use this.

 

How to Get Started with the CSS Adapter Toolkit

 

You can learn more about the CSS Adapter Toolkit and download it from here.  The first thing you should read is the CSS Adapter Toolkit Whitepaper to understand better how it works, and understand the default CSS rules that the CSS Adapters in the toolkit output by default.

 

Once you’ve download and installed the CSS Adapter Toolkit you can then choose “File->New Web Site” using either VS 2005 or Visual Web Developer (which is free) and select the CSS Adapter Toolkit Starter Kit:

 

 

You can choose to create either a VB or C# version of it.  Once created it will install the CSS Adapters, associated .browser files, and a bunch of samples that use it:

 

 

Just select the default.aspx page and hit run to get started.  You can then browse through the samples and step through the adapter code to see how they work.

 

To re-use the adapters as-is, just copy the files in the /app_code/adapters/ sub-directory into your applications, along with the .browser file in /app_browsers.  You will then also want to copy the appropriate static CSS stylsheets and JavaScript files as well.  And then you are good to go.

 

To ask questions about the adapters and/or ask questions, please check out this forum here.

 

Hope this helps,

 

Scott

 

P.S. We are calling this first release of these adapter samples a "beta" and are actively looking for feedback (we'll then update the adapter samples and add more).  Please leave suggestions on how to improve it in this forum here.

 

P.P.S. The CSS Adapter Toolkit is released under a permissive license that allows full re-use of the code for both commercial and non-commercial applications.  Feel free to re-use the adapter code however you want (we’d also love you to post sample adapters that you build!). 

 

P.P.P.S. If you are looking for another really cool extensibility download we’ve done recently, check out this post about the source release of the ASP.NET 2.0 Providers.

Published Tuesday, May 02, 2006 4:47 PM by ScottGu
Filed under: , ,

Comments

# re: CSS Control Adapter Toolkit for ASP.NET 2.0 Released

Tuesday, May 02, 2006 8:13 PM by timh
the site still lists beta 1.1 -- does 'released' mean released as in the update on 4/29?

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 02, 2006 8:20 PM by scottgu
Hi Tim,

I just clarrified the title of the post and added a PS statement as well. By released I meant "now available" -- although that was confusing.

Thanks for pointing this out,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 02, 2006 8:35 PM by Shane Perran
Thank you! This is absolutely wonderful. I cannot stress how much I have been asking for and hoping for this.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 02, 2006 8:46 PM by Shane
That is uncanny. 5 minutes ago I was thinking "I need to add a menu to this site. I'd like to use a sitemap file and the asp Menu control but I'd rather it was more CSS oriented."

Talk about great timing!

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 02, 2006 9:41 PM by Axe
It is great to have this much control over the rendering of the html.
Thanks heaps :)

# Thanks!

Tuesday, May 02, 2006 9:54 PM by Nadav Eshkol
That is so great, you've made my day.
I'm an Israeli developer, so right-to-left alignment is a must (Hebrew). Previously, digging into the menu control and trying to align it (in the horizontal case) was such a pain, I just gave up.
Now, in 10 minutes it's all done.
This sure helps :)

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 02, 2006 10:55 PM by Shawn Oster
I'm amazed at how almost every article you post is a little gem of goodness. I usually save reading your articles until the end of the day because I know I'm going to get engrossed in whatever you've just published.

Thanks for the code/news you are exposing here, they are much appricated.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 02, 2006 11:06 PM by Rahil
Hi, good css news. by the way will this css adaptors will be supporting in Expression web designer too...? Can you focus more on recent happenings in web designer too by a blog or so.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 1:57 AM by Keith J. Farmer
Nice set of website templates you have there.. :)

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 1:59 AM by Jens
Hello Scott,

is there any way to define Control-Adapters in web.config instead of using a *.browser-File?

Thanks!
Jens

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 3:04 AM by Plip

Great Stuff, thanks Scott.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 3:37 AM by elixir
Great!

I've reported this at the feedback center sometime ago. Is this the resolution to that?

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=062564ae-f036-4e21-9419-e7d5b65c96da

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 5:26 AM by scottgu
Hi Rahil,

I will try and post about Expression Web Designer in the future too. It is going to be very cool, and has great support for both CSS and ASP.NET (including Master Pages, Themes, Databinding, etc).

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 5:58 AM by scottgu
Hi Elixir,

Yep -- this adapter toolkit would fix the issue you reported in the feedback center about extra tables or span elements for the data controls.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 6:01 AM by scottgu
Hi Jens,

I don't think there is -- although I'm not 100% sure. You could register them at the machine level if you wanted to avoid declaring them in each app.

In general we've found that people declaring them in .browser files since it avoids having a single file that everyone has to check-in/check-out to update.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 6:04 AM by Vladan Strigo [MVP]
Hi Scott,

Food for thought...

do you think that adapters could be used to "intercept" non XHTML parts (e.g. unclosed tags, non-quoted attributes and such) in a page (by making a page adapter) and converting them to be XHTML compliant at render?

regards,
Vladan Strigo

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 6:08 AM by scottgu
Hi Vladan,

The control adapters themselves participate in the rendering phase, and as such don't intercept the markup output. One benefit of this is that it makes them super fast (whereas parsing output can be sometimes slow).

If you did want to intercept the output and modify it, though, one approach you could use would be to build an HttpModule that plugged into ASP.NET.

Here is a sample XHTML Validation Module that I blogged about last month that does the verification part of what you are looking for: http://weblogs.asp.net/scottgu/archive/2006/04/09/442336.aspx

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 8:39 AM by Vladan Strigo [MVP]
I know about the HttpModule option, just was considering alternatives also.

I (obviously :)) didn't grasp the adapter concept correctly.

thanks,
Vladan

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 9:46 AM by gpr
is there a way to modify the menus so they have less hourglass flickering?

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 9:56 AM by João Cardoso [MVP]
Great stuff Scott.

This comes in good time for a new asp.net project i'm working on

Good timming! :)

Regards!

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 10:04 AM by Granville Barnett
Will CSS adapters be created for all web controls...or at least the ones that generate ugly code??

Really love the improvements so much cleaner to work with!!

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 10:10 AM by Brian O'Connell
This is very nice I must say. Is it possible to use this method to stop some controls from outputting inline styles? Like the gridview for example seems to output a style attribute no matter what properties are set. It would be nice to output style attribute free html with every control.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 10:12 AM by scottgu
Hi GPR,

The menu control is rendering standard <ul><li></ul> output -- which means you can attach any CSS stylesheet to it. I just happen to have a boring and not super clever stylesheet that I'm using - but you can obviously modify it to get whatever look and feel you want (and avoid the hourglass flickering).

Here is a link I found this morning to a few CSS based styles you can now apply to the menu: http://alvit.de/css-showcase/css-navigation-techniques-showcase.php

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 10:14 AM by scottgu
Hi Granville,

You can create CSS adapters for any ASP.NET control (all built-in controls support them). We will continue putting out adapter sample updates that include more of them - although are hope is that lots of people create and share their own too! :-)

Thanks,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 10:15 AM by scottgu
Hi Brian,

Yep -- you could use this to modify the output of a GridView control as well.

Thanks,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 10:56 AM by Tyler Carver
Awesome!! Great job on pushing this ability into the product. I love it.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 2:17 PM by Brian O'Connell
Thanks for the quick response Scott seeing as I believe you are in my City, Dublin, this evening :)
I'm wondering how you could set the browser file to use the adapters for any browser. In general using css and web standards the whole point is that it should work with any browser. Is this just a case of using an * instead of a code for the browser in the browsercaps file?

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 3:12 PM by Maestro
Why not just build the original controls to support clean output?

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Wednesday, May 03, 2006 4:28 PM by Mike Gale
When this is release ready, it will make a huge difference to some people.

There has always been a situation where ASPX is a closed rendering product implemented in ways that some developers won't put their name to. Some have gone the "roll your own" route to get decent results.

Great that we are getting enough control.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 12:50 AM by Ciaran
Hi Scott,
This is fantastic it is exactly what I wanted. But (there is always a but isn't there) I want to be able to specify what control instances can use the adapter, and leave other control instances uneffected by the adapter, I did this by specifiying an attribute on the control during design time.

I implemented this in the adapter by having each overriden function call it's base function if the control does not want to use the adapter. But this does not work 100% i.e. the control does not render itself as if the adapter was not there. In the case of a menu, only the first menu level is rendered and there are no javascript functions attached. Do you know if it is possible to do what I want?

Thanks.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 3:31 AM by ChadT
A video showcasing this in action would be golden! Just like the video you did for Atlas.

Thanks!

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 7:19 AM by Dom
Any examples in vb.net, please?

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 9:36 AM by Complex
I find this very complex and difficult to understand.

This comment here is confusing as well:

"What is cool about control adapters is that they do not require a page developer to program against a new control, or modify the control programming model semantics (you still use the same control properties, methods, events and templates you did before). Indeed – a page developer can be entirely oblivious that a control adapter is being used (the control adapter model makes it very clean to register and encapsulate this support)."

As a page developer (I feel insulted here, but oh well), how can I be oblivious that it is being used if I need to implement this on a page?

Wouldn't it be equally productive to include an option for a control to use CSS and have a GUI CSS interface? Maybe this is just my lack of understanding.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 9:37 AM by Complex
On the 'datalist' example - I cannot switch to design view - is this something I've setup wrong?

Thanks

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 6:59 PM by Jaguar
very useful stuff! thanks

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 7:37 PM by scottgu
Hi Brian,

Yep -- you can do * mappings as well so that you can have any browser pick this up.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 7:39 PM by scottgu
Hi Maestro,

For new controls that is definitely the goal. There will always be cases where you want to override the output though (no matter how clean it is if it doesn't meet your specific requirements). The adapter architecture lets you do this without having to re-build or re-write controls.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 7:41 PM by scottgu
Hi Dom,

The CSS Control Adapters ship with both VB and C# samples. When you create the CSS Adapter Template project just specify VB as the language and you are good to go.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Thursday, May 04, 2006 7:43 PM by scottgu
Hi Complex,

I did not mean "page developer" in a negative sense (when I build a page for a site I think of myself as doing page developement and being a page developer). What I meant was that you can build pages using controls and not have to learn a new control or object model to program against it. The same APIs and programming concepts apply.

What the control adapters give you is exactly what you asked for above. Basically an option for controls to emit CSS based output and to design your page using CSS styles and interfaces.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Friday, May 05, 2006 5:34 AM by www.paketim.com
Great stuff... Thanks.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Friday, May 05, 2006 9:51 AM by Ryan
Well, if you only add the ControlAdaptor for uplevel/compatible browsers and not the * wildcard, be sure to remember to add it for site crawlers too in your .browser file, as your css version will most likely be more search engine friendly. (<gateway refID="Crawler">). Now if I could only figure out why adding |Slurp|Teoma to the gateway.browser crawler identification doesn't pick them up correctly.

Oh, and I save ~60K of Javascript/table markup using a CSS asp:menu. It's slightly less user-friendly, but 60K on each page is huge. So, my users thank you for these examples.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Friday, May 05, 2006 10:07 AM by Tom Sluder
Scott,

Anyway this kind of "article" post could be reposted somewhere that supports easier printing? Thanks again for the tons of useful information coming from your blog.

Tom

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Monday, May 22, 2006 11:33 AM by Dom
Scott,

Just to clarify: If I want to make a control adapter, I have to write code?

I can't, for example, make an XML file that contains the markup to be written along with attributes and "attach" this to the control concerned, setting a property on the control that states the XML file is to be used for markup creation.

Is the code sample above a template I use? How would I modify this for a particular control whose markup I want to alter?

Thanks

Dom.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Monday, May 22, 2006 4:53 PM by Venu
Thanks Scott for the adapters. I wish this is there by default in the controls shifted by Microsoft. I am still trying to experiment and play with the adapters. I was wondering if we can have the xhtml strict doctype used with these adapters. Will the adapters generate the xhtml that passes validation.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Monday, May 22, 2006 11:00 PM by ScottGu
Hi Dom,

If you create a new control adapter then you will write some code (it is fairly minimal code -- basically you author the shape of the HTML to output).

The code sample above includes built-in code samples for modifying the output of 5 of the built-in ASP.NET controls.  We'll be adding even more overtime.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Monday, May 22, 2006 11:01 PM by ScottGu
Hi Venu,

The output we generate from the built-in ASP.NET controls does render XHTML strict markup.  What these control adapters do above is have the output also render using CSS as the default as well.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Saturday, May 27, 2006 5:46 AM by Jean Renier
These adapters are great. The menu control is back in business.

If i have a few webusercontrols consisting of an ascx+codebehind file.
I am planning to compile these ascx files and use the compiled dll in other projects. In those other projects i would like to be able to use this adapter technique to change its output.
Is this possible? and what steps do i have to take to be able to make an adapter for a control in this dll.

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Monday, May 29, 2006 6:01 PM by ScottGu
Hi Jean,

You can use these adapters in any project.  If you want, you can just compile the adapters into the same assembly as your user-control project (although generally I'd probably recommend instead compiling it into a separate class library assembly).  All you then need to-do is add the appropriate .browser declarations to the project and you are good to go.

Hope this helps,

Scott

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 30, 2006 7:35 AM by Dom
Scott,

An unrelated question: how do I get that gold looking colour on my VS 2005?

Thanks

# re: CSS Control Adapter Toolkit for ASP.NET 2.0

Tuesday, May 30, 2006 10:20