views:

33

answers:

1

Is it possible to disable the browserCaps functionality in ASP.NET?

I wish my site to be served reliably and exactly as I have it defined to all browsers regardless of their capabilities.

If their browser can't support the site, that's their problem. My site should not be some how attempting to degrade itself to accommodate the defunct client.

This is very frustrating when it seems to have the bad luck of spiders I guess crawling the site, getting the lesser version of the site causing output caching to serve the stripped file.

A: 

You can put ClientTarget="uplevel" in the page directive or in the Page.Init

<%@ Page ClientTarget="uplevel" ...... %>

or

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) _
        Handles Me.Init
    Page.ClientTarget = "uplevel"
End Sub

Another option is to add a .browser file to your site, in the folder App_Browsers (a default Asp.NET folder). It should target all browser with a regex expression and somehow disable the normal browser detection by adding capabilities. I'm only using this to render the Menu control the right way in Safari but I don't exactly know how to do this for all output at once.

Willem