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
When considering using the user agent string to detect which browser is being used, your first step is to try to avoid it if possible. Start by trying to identify why you want to do it. Are you trying to work around a specific bug in some version of a browser? Look, or ask, in specialized forums: you're unlikely to be the first to hit this problem.
If you want to avoid using user agent detection, you have options! Feature detection is where you don't try to figure out which browser is rendering your page, but instead, you check to see if the specific feature you need is available. If it's not, you use a fallback.
As the above code demonstrates, there is always a way to test browser support without user agent sniffing. There is never any reason to check the user agent string for this. Lastly, the above code snippets bring about a critical issue with cross-browser coding that must always be taken into account.
Feature detection is where you don't try to figure out which browser is rendering your page, but instead, you check to see if the specific feature you need is available. If it's not, you use a fallback.
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.
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)...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With