How do I disable downlevel rendering in ASP.NET?

烈酒焚心 提交于 2019-12-01 05:57:12

问题


How do I disable downlevel rendering of my ASP.NET 2.0 site?

I have a single master-page that all the other pages inherit from, and do not want "downlevel"-versions of the server-controls to be sendt to Google and W3C-validators. The best thing would be if this feature could be disabled for all users on all pages on my site.


回答1:


There are a number of ways to do this.

At the page level (either declaratively or in code) you can use the ClientTarget property of the page:

ClientTarget="Uplevel" // Will force to IE6 capabilities.

Alternatively as Annakata's just posted, using a browser caps setting




回答2:


There's a native component and some config possibilities for this.

Googling "browser capabilities" or "browsercaps" throws up some good links, but here's a couple of solid ones from MSDN.

  • ASP.NET Web Server Controls and Browser Capabilities

  • browserCaps Element (ASP.NET Settings Schema)



来源:https://stackoverflow.com/questions/457399/how-do-i-disable-downlevel-rendering-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!