Configure Visual Studio 2005 for "Classic" ASP syntax highlighting and intellisense

31. October 2005

You can use the Visual Studio 2005 IDE to edit your Classic ASP files and still utilize syntax highlighting and intellisense. All you have to do is associate the “.asp“ file extension with the Web Form Editor. When doing this you are telling the IDE to treat “.asp“ files the same as “.aspx“ files, in turn sort of “tricking“ the IDE in to giving you the syntax highlighting and intellisense that you want.

The steps in setting up the IDE are as follows:

  1. Open Visual Studio
  2. Goto the "Tools" menu and click "Options..."
  3. Check the "Show all options" checkbox in the bottom left of the dialog box.
  4. In the right pane expand "Text Editor" and select "File Extension"
  5. Enter "ASP" extension in the "Extension" textbox
  6. Select "Web Form Editor" in the Editor dropdown box
  7. Click the "Add" button and click "Ok" on the dialog box.

And now enjoy all the syntax highlighting and intellisense features for JavaScript, HTML and Visual Basic while editing your Classic ASP files.

General



Comments

Matt
Matt
1/10/2006 2:18:00 AM #
Syntax highlighting works, but not Intellisense.
1/25/2006 4:40:00 AM #
Honestly, I think that this helps a bit but for better functionality, you really need to add the following line to the top of every page.  Not an ideal solution by any means...

<% @ Language=VBScript %>
1/25/2006 4:41:00 AM #
ASP was stripped out...

@ Language=VBScript

Note, you will need to enclose in the ASP tags...
Tom Shelley
Tom Shelley
3/17/2006 4:44:00 AM #
Intellisense of the VBScript sections contained within <%%> still do not work.  I have my web pages split across multiple files and cannot use the @language=vbscript at the top of each file because the of syntax error it produces.  I guess I could put it there temporariliy to get the intellisense; but it's so much easier to just use Visual Studio 2003 instead.  I guess I have yet to be converted.
Les Matheson
Les Matheson
7/31/2006 11:40:00 PM #
That did the trick, thanks!
John
John
9/14/2006 6:57:00 PM #
Has anyone resolved this issue as we are in the same boat! Any help would be appreciated
11/23/2006 12:09:00 PM #
Putting <%@ Language=VBScript %> at the top of every page worked great for me...Intellisense and syntax highlighting.  Thanks!
Chris
Chris
12/14/2006 6:50:00 AM #
Downgraded to 2003. Works a charm.
1/3/2007 3:09:00 PM #
Worth noting that this tip also works with Visual Web Developer Express, which is somewhat more free than VS! (Handy for on-site degugging etc)
2/1/2007 11:33:00 AM #
To make this work for include files, instead of using normal < %  % > tags, instead use  script runat="Server" language="VBScript"   /script tags to enclose functions. (put the brackets in at appropriate places)

Only do this for functions and not inline code, as the inline code will not execute in the order you expect.
Comments are closed