Language=VBScript

ASP Basics

If you look at the very top line of ASP Classic code, you’ll often see a line that looks like this:

<%@ Language=VBScript %>

or maybe this:

<%@ Language=”VBScript” %>

What is that line all about?

When ASP is processing code on the server, the normal system default for the language processing is VBScript – that is, Visual Basic script. When you find helpful syntax on the web, that’s the language it’s usually being provided in.

But some places to choose to have their default ASP system language to be JavaScript. If an entire installation was JavaScript, and you had some pages you wanted to use their VBScript code, you’d want to make sure this command was at the very top of the page.

Let’s take it a step further. Let’s say you code an entire website in VBScript. Then at some point someone decides they need to change the server-level setting to JavaScript for some reason. Now all of your pages would break until you put this specific command at the top of each one. You’d have to run a search-and-replace across all ASP pages on your entire site, specifying your use of VBScript in each one.

For that reason, many ASP programmers start each page of code with the command, just to be clear. It might seem redundant, but it’s a safety net in case anybody changes the master setting on the server.

Ask with any questions!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.