I'm developing and asp.net web application.In that application i uses an asp menu control and apply a css class to that menu control.Css works fine when i debug the project. But after publishing and uploading on web hosting account.It doesn't show the css effects.
.primaryStaticMenu
{
background-color: Transparent;
border:solid #D1FCFF 1px;
font-family :verdana , verdana_font;
font-size:inherit;
color:red;
}
.primaryStaticMenuItem
{
width: 8em;
border-right: 2px solid #FFFFFF;
padding: 0.2em 0 0.2em 0.2em;
font-family: verdana, verdana_font;
font-size: inherit;
height: 25px;
color: inherit;
background-color: #78B7EF;
}
.primaryStaticHover
{
color: #800000;
border: 1px solid #74C4C1;
background-color: #9AC47D;
}
.primaryDynamicMenu
{
width: 18em;
border: 1px solid #D1FCFF;
font-family: verdana, verdana_font;
font-size: inherit;
color: Red;
background-color: #78B7EF;
}
.primaryDynamicMenuItem
{
width: 18em;
height:1.8em;
padding: 0.5em 0 0.5em 1em;
border: 1px solid #D1FCFF;
font-family: verdana, verdana_font;
font-size: inherit;
color: Red;
background-color: #78B7EF;
}
.primaryDynamicHover
{
font-family :verdana , verdana_font;
font-size:inherit;
color:#AD0000;
border: 1px solid #74C4C1;
background-color: #9AC47D;
}
<asp:Menu id="menuPrimary" runat="server" DataSourceID="xmlDataSource" Orientation="Horizontal"
StaticEnableDefaultPopOutImage="false" StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="5" CssClass="MyMenu">
<DataBindings>
<asp:MenuItemBinding DataMember="MenuItem" ValueField="Tag"
NavigateUrlField="NavigateUrl" TargetField="TestTarget"
TextField="Text" ToolTipField="ToolTip" />
</DataBindings>
<StaticMenuStyle CssClass="primaryStaticMenu"/>
<StaticMenuItemStyle CssClass="primaryStaticMenuItem"/>
<StaticHoverStyle CssClass="primaryStaticHover"/>
<DynamicMenuStyle CssClass="primaryDynamicMenu" />
<DynamicMenuItemStyle CssClass="primaryDynamicMenuItem"/>
<DynamicHoverStyle CssClass="primaryDynamicHover"/>
</asp:Menu>
Problem is solved by just adding controlRenderingCompatibilityVersion="3.5" in web config file.
<pages controlRenderingCompatibilityVersion="3.5" >
<controls>
.......
</controls>
</pages>
Now my menu control shows all effects.