+4  A: 

Classic ASP intellisense is, as you've observed, broken in VS2008. Microsoft actually completely cut support for Classic ASP syntax coloring and intellisense in VS2008 RTM, then restored it in SP1 due to outcry from customers. Take a look at this bug report on the Microsoft Connect site for more info on how it got restored.

Anyway, let me detail exactly how it's broken. What you're seeing is not actually VB intellisense-- instead, you're seeing methods and objects which are present in any of the following:

  • the server-side Response object sometimes other server-side objects like Session or Request, as if there were a javascript "with" statement for these objects before any of your code. this makes no sense-- it's a bug in VS.
  • the client-side window object (!!!!). This makes no sense since this is server-side script. it's a bug in VS.
  • javascript keywords and global objects like String. This is expected (although if you define your script using runat=server, it works more reliably-- if I define the script with <% %> I often don't get proper keyword intellisense.

Note that none of these are VB Intellisense-- what you're seeing are simply PascalCased methods of valid built-in methods of the Request, Response, etc. objects built into Classic ASP's server-side script object model.

Anecdotally, I've found intellisense to work much more naturally in runat=server script blocks than <% %> blocks. At least with runat=server, I get intellisense for typing "Request.", "Response.", etc. and also jscript keyword intellisense seems to work better in those blocks too.

There are other quirks in intellisense, like when you have a <% %> script block, when you type a character, the character is ignored in the list of intellisense choices you get back. (this also works better in runat=server blocks)

In other words, this is all very broken. I have no inside information about why it's so busted, other than this is a feature which was deprecated in VS2008, brought back in a service pack, and likely has far less testing than other parts of VS-- so it's not surprising it's broken. Especially when you consider that it's supporting a feature, classic ASP, which Microsoft probably wants to go away. That doesn't mean the Redmontonians are actively trying to sabotage this, but in a team with limited resources, making classic ASP work great is probably not going to attract the same level of attention as, for example, ASP.NET MVC.

That said, IMHO even this limited support is better than what was there in VS2008 RTM, when classic ASP files looked like notepad, wtih no intellisense or syntax coloring at all.

If you're annoyed at this sorry state of affairs, I'd suggest filing a bug report at https://connect.microsoft.com/VisualStudio. Just like a bug report got Microsoft to restore classic ASP intellisense in VS2008 SP1, it might get them to fix it for SP2 and/or VS2010. You might also want to check out the latest VS2010 beta to see if the problem is fixed or worse.

Sorry if this isn't the answer you were hoping for. :-(

Justin Grant