Is there a way to disable .NET browser detection?

二次信任 提交于 2019-12-22 05:36:19

问题


I failed to find a way to disable the browser detection feature added by asp.net 2.0.
I want all the request to my page to be treated as if IE is requesting them.
My fix was to add an App_Browsers folder to my project and in it have the following .browser file:

<browsers>
  <browser refID="Default">
    <capabilities>
      <capability name="preferredRenderingMime" value="text/html" />
      <capability name="preferredRenderingType" value="html32" />
      <capability name="requiresFullyQualifiedRedirectUrl" value="false" />
    </capabilities>
  </browser>
</browsers>

Is there a way to turn this feature off altogether?

Thanks


回答1:


One of the more offensive parts of ASP.Net, imho. No way to just turn it off AFAIK, other than config like this.

You may be interested in Rob Eberhardt's pool of resources on the topic.




回答2:


You can override the browser detection by setting the ClientTarget property on the page to the choice you would like it to make (probably uplevel in your case)...



来源:https://stackoverflow.com/questions/435989/is-there-a-way-to-disable-net-browser-detection

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