Ability to use either CSSFriendly or original menu

Jul 9, 2007 at 1:15 PM
I am looking for some advice or a few pointers to assist me, if you would be so kind.

I have implemented CSSFriendly into a project I am busy with. The initial implementation was a breeze. Well done!

My difficulties started with CSS support for IE6 (despite the CSS sample provided). Implementation on IE7 and Firefox went well. One or two z-index issues in IE7 but with some Googling I resolved those issues.

But, other than the simplest of menus, IE6 seems not to comply with what I want despite the use of IEMenu6.css.

So, I figured that I would detect any older browsers (and I am going to include IE6 in this list) and revert any of these to the old table based menus. However, I couldn't immediately think of an elegant way to achieve this.

In other words, I would like to switch the Adapter off for selected browsers, or alternatively, switch the Adapter on for selected browsers. (Don't mind which.)

Do you have a suggested method or methods that I could investigate and experiment with.

Any advice would be appreciated.
Jul 9, 2007 at 5:44 PM
Check the CSSFriendlyAdapters.browser file in the App_Browsers folder. There should be several <browser> elements which allow you to control exactly which browsers will use the control adapters.

See http://msdn2.microsoft.com/en-us/library/ms228122.aspx for more info.
Jul 9, 2007 at 9:29 PM

LonelyRollingStar wrote:
Check the CSSFriendlyAdapters.browser file in the App_Browsers folder. There should be several <browser> elements which allow you to control exactly which browsers will use the control adapters.

See http://msdn2.microsoft.com/en-us/library/ms228122.aspx for more info.


Thank you LonelyRollingStar:-)

This did the trick. It took me a while to figure out how it all worked but it was worth it. In fact, it will be a great help to another challenge facing me.

For interest sake, I defined the following browser definitions:

PS: I assume that the purpose of the W3C_Validator is only to allow the W3C Validator to validate the markup.

-----------------------------------------------------------------------
<browsers>

<browser id="IE7to9" parentID="IE6to9">
<identification>
<capability name="majorversion" match="^7-9" />
</identification>
</browser>

<browser refID="IE7to9">
<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>

<browser id="W3C_Validator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>
<capabilities>
<capability name="browser" value="W3C Validator" />
<capability name="ecmaScriptVersion" value="1.2" />
<capability name="javascript" value="true" />
<capability name="supportsCss" value="true" />
<capability name="supportsCallback" value="true" />
<capability name="tables" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
<capability name="w3cdomversion" value="1.0" />
</capabilities>
</browser>
</browsers>
-----------------------------------------------------------------