Don't explicitly set the page language in ASP

As you probably know, IIS uses VBScript as the default scripting language for Active Server Pages. Very often, however, we've seen pages where a Web developer has still explicitly set the scripting language for an ASP page by using the @Language directive, like this:

<%@ Language = VBScript %>
<%
'...
%>

In fact, there's a small but measurable performance degradation on pages where the scripting language is set explicitly, so unless you have a reason to change the scripting language for an individual page to something other than the default, you're much better off sticking to the default and omitting the @Language directive. This is particularly important in high-traffic sites. If you want an entire site to use another scripting language, JavaScript for example, configure IIS accordingly and omit the directive from the individual pages.

To change the scripting language in IIS, select a site or virtual directory to change, then choose Properties from the Action menu in the Internet Services Manager. Then, on the Directory tab (Home Directory, if you're configuring an entire site), click the Configuration button. In the resulting dialog box, click the App Options tab and change the Default ASP Language.

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - Rick Osborne