Search code examples
asp.nethtmlcssaspmenu-control

Why does the asp.net 4 menu control add CSS CDATA to the HTML on page rendering?


I'm running my company site through http://analyze.websiteoptimization.com trying to speed it up, and drop unwanted weight. I was looking through my HTML source code of a rendered page, and noticed that the ASP.net Menu control has added CSS stylesheet CDATA.

I've added .elfabMenu img.icon { border-style:none;vertical-align:middle; } to the stylesheet to see if its adding CSS thats not defined, although it still hangs around.

Whats the reason for having it there, and how do I get rid of it?

Thanks, Rocky

/* <![CDATA[ */

#ctl00_ElfabMenu img.icon { border-style:none;vertical-align:middle; }

#ctl00_ElfabMenu img.separator { border-style:none;display:block; }

#ctl00_ElfabMenu img.horizontal-separator { border-style:none;vertical-align:middle; }

#ctl00_ElfabMenu ul { list-style:none;margin:0;padding:0;width:auto; }

#ctl00_ElfabMenu ul.dynamic { z-index:1; }

#ctl00_ElfabMenu a { text-decoration:none;white-space:nowrap;display:block; }

#ctl00_ElfabMenu a.static { padding-left:0.15em;padding-right:0.15em; }

#ctl00_ElfabMenu a.popout { background-image:url("/WebResource.axd?d=Vs-xm3V4xXyes-Nkxpn4TcXoSMRRIWln2M_xmx8FHGw0xawO9dtWkvxPKOuCep8TMQfm6ipPg_hERtowJQpR_GaQaYnKwCcyHxEw5R6i3rfaWcpT0&t=634509612784300257");background-repeat:no-repeat;background-position:right center;padding-right:14px; }

/* ]]> */


Solution

  • http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.includestyleblock.aspx

    includeStyleBlock ="false"