views:

28

answers:

1

Some times there are an intellisense problem in the views, the namespaces in the referenced assemblies don't appear in the intellisense only in views but the do appear in .cs code files in the same project..

i've tried these ways:

<pages>
  <namespaces>
    <add namespace="MyNameSpace" />
  </namespaces>
</pages>

in the web.config file

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
         <add assembly="SomeAssembly.Name" />
      </assemblies>
    </compilation>

and:

   <%@ Assembly Name="SomeAssembly.Name" %>
     <%@ Import Namespace="SomeNamespace.Name" %>

at the beginning of the view

A: 

Yes that happens. Intellisense is not perfect especially in views. Try recompiling the project after adding the necessary references, run it to make sure that it works at runtime and if you still don't get Intellisense in the views you can curse at Microsoft. Happened to me today but even worse in a C# file (restarting Visual Studio fixed it :-)).

Darin Dimitrov
Yah, I would say restart VS. That usually fixes it. If that does not work, reboot... and no Im not kidding. As long as you didnt do something silly, thats bound to fix it.
CrazyDart
@CrazyDart, cursing at Microsoft also helps sometimes :-)
Darin Dimitrov
@Darin Dimitrov unfortunately this didn't help, some references only cause the problem, but most other references are shown in the views intellisense!!
Mohammad Sakher Sawan