Is it actually a compile error, a runtime error, or is it just intellisense that's not working?
The namespaces are right; I assume you have the latest assemblies in the references, and are using an actual ViewPage or ViewUserControl rather than a 'classic' Page or UserControl...
The only other thing that might cause it is that I"ve seen compilation errors elsewhere affect the view and either stop intellisense from working or make it look like the error is in the view, even though it happens elsewhere (this is usually b/c of deferred
execution).
Help those who have helped you... remember to "Mark as Answered"
shapper
Contributor
3932 Points
3789 Posts
Html Helpers on recongnized on views
Apr 15, 2009 06:04 PM|LINK
Hello,
I am working an ASP.NET MVC 1.0 application and on my views the Html Helpers are not recongnized.
I even copied some code from my previous MVC application but the Html Helpers keep not being recongnized. Any idea?
I have, for example:
<%Html.RenderPartial("Menu");%>
And on my Web.Config I have:
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/>
</namespaces>
Any idea what is going wrong?
Thanks,
Miguel
paul.vencill
Contributor
6716 Points
1358 Posts
Re: Html Helpers on recongnized on views
Apr 15, 2009 06:28 PM|LINK
Is it actually a compile error, a runtime error, or is it just intellisense that's not working?
The namespaces are right; I assume you have the latest assemblies in the references, and are using an actual ViewPage or ViewUserControl rather than a 'classic' Page or UserControl...
The only other thing that might cause it is that I"ve seen compilation errors elsewhere affect the view and either stop intellisense from working or make it look like the error is in the view, even though it happens elsewhere (this is usually b/c of deferred execution).
shapper
Contributor
3932 Points
3789 Posts
Re: Html Helpers on recongnized on views
Apr 15, 2009 06:39 PM|LINK
Hi,
It started working out of nothing ... I just restarted VS and rebuilt it.
I had this kind of problems before but arounf Preview 2 or 3 ...
Have no idea why this happens ...
Thanks,
Miguel