Pages

Sunday, July 17, 2011

How to add custom browser definition files?

ASP.NET uses browser definition files to determine the capabilities of the browser (Ex: JavaScript, cookies, ActiveXControls etc.) which request comes from. Accordingly it will create the mark up as the response to client.

Browser definition files are located in, C:\WINDOWS\Microsoft.NET\Framework\\CONFIG\Browsers\

To add a custom browser definition file, copy the *.browser file to the above location and run Aspnet_regbrowsers.exe tool.

You can add custom browser files in App_Browsers folder in ASP.NET web site as well.

2 comments:

  1. this is a bad idea because the files will be overwritten every time the framework is updated; you will just lose the changes and have to manually keep track of it.

    Instead, you can right click on your project > add > asp.net folder > App_Browser and then right click on App_Browser that you just added and select Add new file, call it generic.browser or whatever else you may want to call it and specify your changes there, so it will always stay as a part of the project..

    ReplyDelete
  2. Thank you very much bendekay. That is excellent information.

    ReplyDelete