Last post Jan 25, 2008 06:34 PM by MikeJ83
Jan 22, 2008 09:05 PM|rfurdzik|LINK
I use menu in two places in the website: Main menu and User Menu. While I want to use CSS Adapter for Main menu, I do not want to use CSS Adapters for USer menu. It is the same tag in both places: asp:menu.
Jan 24, 2008 02:32 PM|Bugyis|LINK
"...once you set up your adapters to run in your project, there is no real way to turn them off. It's not as if you can say "okay, GridView1, you use the adapters. But GridView2? No way; I want to style you myself" If they are on, they are on. If they are
off, they are off"
He goes on to say:
"The quasi-exception to that is the use of another non-standard property: AdapterEnabled", and "this is only there for experimentation Will it work? Don't know"
In the CSS Adapters white paper:
"Beware: this is not supported and often does not work well. Fundamentally, the framework does not support disabling adapters on a per control basis. The AdapterEnabled attribute is only intended to be used experimentally"
Its not exactly good news, but I hope it answers your question.
Jan 24, 2008 05:04 PM|rfurdzik|LINK
What about skinning (with different CSS) two different controls (same type - menu) using table adapters? Is that possible?
I bought the book... :)
Jan 24, 2008 06:30 PM|Bugyis|LINK
Yep. I believe you just set the CssSelectorClass property differently on each menu. Like this:
Jan 24, 2008 07:03 PM|rfurdzik|LINK
Jan 25, 2008 11:00 AM|Bugyis|LINK
I don't think so - I mean, you still only have one <asp:menu> control. I'm not completely sure on this one, but it doesn't seem likely.
Jan 25, 2008 06:34 PM|MikeJ83|LINK
It is possible, but the solution is not very elegant:
Create a new control, call it something like MyMenu, and inherit from System.Web.UI.WebControls.Menu. Then in your browser.compat file, set your custom CSS adapter to adapt the MyMenu control (and leave the CSS Friendly adapter on Menu, or vice-versa).
Actually, now that I think about it you may need to create a second custom control, again inheriting from System.Web.UI.WebControls.Menu, and have the CSS Friendly adapter act on that control (Rather than directly on System.Web.UI.WebControls.Menu). Let
me know if this doesn't work out, and I'll go back to some of my old code that does this and see how I did it (I am having trouble remembering now).