简体   繁体   中英

ASP.NET 4.0 control rendering in 3.5 style on IIS6

I am using an ASP.NET menu control in a website that is configured to use .NET 4.0 in IIS. On my development machine with IIS 7.5, the menu control is rendered using CSS styles, as is the expected behavior for ASP.NET 4.0 and up.

However, on an IIS 6.0 web server, the menu control is rendering using inline styles, the expected behavior for ASP.NET 3.5 and below. The website on the server is, in fact, configured to use .NET 4.0, which I confirmed using aspnet_regiis -lk . I even tried adding <pages controlRenderingCompatibilityVersion="4.0"/> to the system.web section of the website's web.config file, and it is still rendering using inline styles.

Does anyone know why this might be happening or how to force it to render in the ASP.NET 4.0 manner on the IIS 6.0 server? Thanks!

It looks like it wasn't actually using the 3.5 rendering mode; the actual reason that the CSS styles that I was expecting were not appearing is an ASP.NET 4.0 bug discussed previously on stackoverflow and this blog . The issue is fixed in ASP.NET 4.5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM