views:

2515

answers:

4

If I open a file in Design View (web form), I get intellisense for my display code, but not my script code.. If I open with source code editor I, occasionally, get intellisense within the script tags.

Anyone know how to get intellisense working all of the time for all of my code?

Been living with this one for a long time.

A: 

Some service packs have broken Intellisense and in the past I have had to either reinstall the product or repair. Try repair first!

Ray Hayes
A: 

I'm not sure if it helps, but I've been working on some code recently which uses a bunch of projects compiled using NMake. For those, there's an option if you right-click on the project and select the NMake option (I guess you might have a web form option in there?). I found intellisense often wouldn't pick everything up unless I set the right include directories:

  1. Right-click on the project.
  2. Select NMake (or whatever it is you 'compile' the form with) from the tree of options on the left of the dialog.
  3. In the pane on the right you'll hopefully see a bunch of options under an 'intellisense' listing.
  4. Make sure the files you're interested in intellisensing are in a directory which is listed in the 'Include search paths' option.
Jon Cage
+1  A: 

What version are you using? Design view is for human-readable elements, you wouldn't be editing code there and therefore wouldn't need intellisense. If you are not using code-behind, you should only have one tag on the page, and you would edit this in Source view. To enable intellisense, add the following on the first line:

<%@ Page Language="C#" %>

If you change it, the tag will be underlined and it will say that you need to close the file and reopen it.

If you are in VS 2008, JavaScript intellisense will be available to you as well. Make sure you specify the language in the tag.

alord1689
+1  A: 

VS2008. So far doing a re-install seems to be the best advice. I am using the <%@ Page Language="C#" MasterPageFile="~/common/masterpages/MasterPage.master" %>. When I say design-view I mean that I right+click on the file and choose "view designer" - this gives me access to the toolbox and tabs for designer,split, and code-view (which is the view I primarily work in). In that mode, all of my <asp: tags get intellisense, but then I lose all intellisense within my <script> tags. I've never been able to have intellisense working both within the <script> tags and within my form.

I should say that when we create a website, we don't do it through file>new>website.. I mention this because I wonder if VS might configure a website differently when creating it that way vs. pointing VS to an existing set of directories which contain our website.

madcolor
Do you specify the language in your script tags?
alord1689