Reputation: 47
I have a ASP.NET MVC 1 application and using Visual Web Developer Express. I can not get the Html.RenderAction("Controller","Action") to work on my MasterPage. (Site.Master) in the Shared folder.
VWD says "Html" is not recognized here.
I took to the following steps to implement the Html.RenderAction("Controller","Action") method.
Downloaded Micrsoft.Web.Mvc.dll
Updated the web.config with a reference to Micrsoft.Web.Mvc.dll '
I added a reference to Micrsoft.Web.Mvc.dll in my project manually.
I'm following the book: Pro ASP.NET MVC Framework by Steven Sanderson and downloaded the sample file where he covers this topic (Ch 4 - 6) and his sample file is giving me the same error?
Please help!
Thanks! Quinntyne
Upvotes: 1
Views: 1223
Reputation: 1116
Sample code would help.
A few things:
When you say that you "added a reference in your web.config,", make sure you added the namespaces to the namespaces section:
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
Adding that last one will probably address the issue.
Upvotes: 2