I have a site that is hosted in a load balanced environment (cloned 2008SP2 servers running IIS7). When the site is being displayed in FireFox or Chrome, one instance ignores the VBscript block (as expected, as both of browsers do not support VBScript), but the other writes the server-side code to the client as plain text. The code is exactly the same on both servers. The code executes as expected in IE.
What configuration setting needs to be enabled on server-side (IIS) to ignore VBscript code while running in incompatible browsers (ie. Firefox or Chrome)?
I’ve been looking at this for hours and have not found any solutions other than to comment out the script blocks on the other server, but I don’t feel like I should have to do that since it being omitted as expected on one server.
To be clear: the browser writes the code
<%@ Language=VBScript %><% Option Explicit ... %>
to the page while in Firefox/Chrome on one server, but omits it on the other (as expected). The script executes correctly on both servers in IE.
Any thoughts?
When vbscript or asp is written in htm/html files, IIS7 will not parse the content in browsers other than IE. To parse the content in other browsers, add the following to the web.config under the tag.
This tells IIS to map htm/html to the asp.dll and adds in the handler mappings.