How can I stop ASP.NET controls to create inline html style elements?

I have a main page containing the server side of the ASP.NET Office menu (System.Web.UI.WebControls.Menu)

I am using CSSFriendly adapters here

http://www.asp.net/CSSAdapters/Menu.aspx

and they make the made HTML a lot cleaner, but I still get the inline styles output to the HEAD element in the HTML, like this

<style type="text/css">
    .ctl00_SiteHeader1_TabBar1_Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }
    .ctl00_SiteHeader1_TabBar1_Menu1_1 { text-decoration:none; }
    .ctl00_SiteHeader1_TabBar1_Menu1_2 {  }
    .ctl00_LeftColumnContent_LeftHandNavigator1_Menu1_0 { text-decoration:none; }

</style>
</head>

<body>

I want these styles to be generated by ASP.NET, I don’t think I need them because I use CSSAdapters, so is there a way to stop them from being created?

Derek

+5
source share
2 answers

, . .

onprerender . , tagMappings.

, .

+1

.NET Framework 4 ASP.NET IncludeStyleBlock, false, <style>. , - style="float:left", float: none !important .

+3

All Articles