CSS Friendly + asp:menu control

Last post 08-27-2009 12:22 PM by sprockincat. 7 replies.

Sort Posts:

  • CSS Friendly + asp:menu control

    06-10-2009, 6:41 PM
    • Member
      15 point Member
    • radion_auto
    • Member since 10-26-2008, 10:27 AM
    • Posts 44

    Hi there, basically im having some problems with the annoying generated styles that .net puts in when using controls with the css friendly component. It seems to auto generate a load of css styles and put them in a webresource.axd file. the content of these is playing havoc with my css.

    I dont really want it to generate any css for me, i cant write it myself, but ill be damned if i can find where it is disabled!

    Anyone able to tell me how i can strip out all of the formatting .net puts into the menu?

    Cheers

    Charles

  • Re: CSS Friendly + asp:menu control

    06-11-2009, 2:03 AM
    • Contributor
      2,074 point Contributor
    • cgeers
    • Member since 02-21-2009, 7:41 AM
    • Belgium
    • Posts 275

    If you are using the CSS Friendly Adapters than you should have the CSSFriendlyAdapters.browser file present in the App_Browsers directory.

    Open this file and comment out the following line to disable the CSS Friendly Adapters for the ASP.NET Menu control.

    <adapter controlType="System.Web.UI.WebControls.Menu"
        adapterType="CSSFriendly.MenuAdapter" />
    Using this file you can choose to which controls the CSS Friendly Adapters are applied.
     
    Please mark my reply as an answer if it helps you.

    Check out my blog
  • Re: CSS Friendly + asp:menu control

    06-11-2009, 2:56 AM
    • Member
      15 point Member
    • radion_auto
    • Member since 10-26-2008, 10:27 AM
    • Posts 44

    Thanks for the reply, but that is not really the behavior i am after. I still want the html layed out css-style (with UL and LI's instead of dirty tables) i just dont want all the css stylesheet markup auto generating, any ideas?

    Cheers

    Charles

  • Re: CSS Friendly + asp:menu control

    06-11-2009, 12:48 PM
    • Member
      15 point Member
    • radion_auto
    • Member since 10-26-2008, 10:27 AM
    • Posts 44

    Is there a way to do this without having to recompile the CSS friendly component? i can't actually do this as my visual studio does not allow me to load C# projects for some reason, and there is no VB version that i could find..

  • Re: CSS Friendly + asp:menu control

    06-11-2009, 6:34 PM
    • Member
      15 point Member
    • radion_auto
    • Member since 10-26-2008, 10:27 AM
    • Posts 44

    Could somone please tell me how i get rid of these annoying auto generated styles? .net is putting a "height:1% !important;" on A tags inside my menu, this totally messes up IE6 compatibility and i cant seem to get rid of it!

    This has sadly halted my progress with the site for several hours now, what a waste for such a silly problem :(

    Charles

  • Re: CSS Friendly + asp:menu control

    06-15-2009, 6:37 AM
    • Member
      15 point Member
    • radion_auto
    • Member since 10-26-2008, 10:27 AM
    • Posts 44

    *bump*

    Anymore ideas on this? i am still banging my head against a brick wall trying to get my page to display in IE6!

    Thanks

    Charles

  • Re: CSS Friendly + asp:menu control

    08-24-2009, 4:56 PM
    • Member
      10 point Member
    • moogleii
    • Member since 05-21-2007, 8:51 PM
    • Posts 18

    Radion, what version are you using? I'm running into the same problem with IE6 and menus, even after I overrode all the built-in styling with my own (verified with firebug). I'm on build 24242. I was under the impression 1.0 could give you pure css-friendly html without built-in styling?

    From what i see in the code, for 24242 anyway, it looks like it'll take a rebuild. Actually, after i thought about it some more, it looks like if you apply your own !important property to all your own css, taking care to override everything the built in css does, you should be able to style it exactly as you want. It worked for me.

    I've got to say, I kind of disagree with the bundling of the CSS. I apologize if I'm making some short-sighted assumptions since I've only given the project a cursory glance, but it seems like it would be more powerful and flexible to keep the CSS in a separate file that users can use, rather than integrating it into a built-in axd resource. From a styling point of view, if I'm building something from the ground up, I'd rather have blank, css-friendly html, rather than something pre-styled.

  • Re: CSS Friendly + asp:menu control

    08-27-2009, 12:22 PM
    • Member
      2 point Member
    • sprockincat
    • Member since 02-25-2008, 3:02 PM
    • Snoqualmie, WA
    • Posts 5

    If you want to drop out the included CSS and javascript you will have to edit the adapter classes and recompile. Or, if you're just using the menu adapter, you could just drop the MenuAdapter.cs and WebControlAdapterExtender.cs files into your App_Code folder. From there you can just modify the MenuAdapter to not register the scripts. I had to do some modifications to change/add some CSS class names as well.

    Also, if you're looking for some nice CSS and javascript to replace the built in stuff, Superfish is working great for me. I'm not that great with CSS and the Superfish styles were much easier for me to modify than the CSSFriendly styles were.

Page 1 of 1 (8 items)