browserCaps

Discussion in 'ASP.NET 2.0' started by uniquesjc, May 5, 2006.

  1. Hi

    Can any ops out there pleasetell me how often the browserCaps section of your machine.config file is updated. I have found that some browers, like Opera, work better when I update my web.config file with the latest browserCaps settings I can find.

    SteveC
     
  2. I believe the browserCaps element has been deprecated in .NET 2.0. There are now browser definition files located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers. We don't usually update these, and we rely on future framework service packs for the updates. So, you'll have to continue updating the web.config if you want the latest definitions.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Oh, and you can also create your own browser definition files and place them in the App_Browsers directory of your app.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. It's an old post but I've got a question causing me to resurrect it. I have an updated .browser file that includes many browser definitions - many thanks go to Owen Brady (Ocean at owenbrady dot net). I've included it in my applications App_Browsers folder but the application does not appear to be matching Google Chrome and the regex in the file looks good matching against Chrome's http_user_agent.

    I'm hopefully expecting to be able to use Request.Browser.Browser and Request.Browser.Version once the .browser file is recognized to pull the correct browser ID out. Does anyone know how these things work?

    Cheers,
    Joe
     
  5. Ah well problem solved. For the record here's what I did;

    A short while ago I had a Chrome issue with the asp:menu control where the client script stuff for drop down on hover wasn't working and the default rendering was looking strange. I initially thought I had solved it with this code:

    if (Request.ServerVariables['http_user_agent'].IndexOf('Safari', StringComparison.CurrentCultureIgnoreCase) != -1)
    this.Page.ClientTarget = 'uplevel';

    In fact it did actually seem to get the menu working, but I've now found it also had the side effect of making Chrome get recognized as IE5.5 with my new .browser file. Anyway to fix it I've ripped out the above code and browser recognition and asp:menu functionality is now working as it should.
     

Share This Page