0

I am getting the "System.Web.WebPages.Html.HtmlHelper does not contain a definition for Partial and no extension method Partial accepting a first argument of type System.Web.WebPages.Html.HtmlHelper could be found" error message when using @Html.Partial. BUT, it still works as expected, and my partial shows up. I want to get rid of the error however. Here is my html, if it helps :-

<div id="reference">
@Html.Partial("Reference/_PermissionType")
@Html.Partial("Reference/_ProtocolType")
@Html.Partial("Reference/_ResponseType")
@Html.Partial("Reference/_SystemType")
</div>
Kartikeya Khosla
  • 18,743
  • 8
  • 43
  • 69
Scott
  • 2,456
  • 3
  • 32
  • 54

1 Answers1

0

Just Copy web.config file from Views folder and put it in your Reference folder from where your partial views are referenced.

Kartikeya Khosla
  • 18,743
  • 8
  • 43
  • 69
  • Tried it, but got same error. Since my Web.config file is in the Views folder, shouldn't it be picked up by all cshtml files that are in folders in Views? And why would everything still work, even though I am getting errors? – Scott Aug 09 '14 at 15:01
  • @Scott...strange how this is possible...you are getting errors on runtime or compile time???? – Kartikeya Khosla Aug 09 '14 at 15:03
  • If I unload the project and set MvcBuildViews to true in the .csproj file, I get compile errors, but the app still runs fine. Yes, very strange. – Scott Aug 09 '14 at 17:04
  • just read this link....http://stackoverflow.com/questions/4725387/mvcbuildviews-not-working-correctly/4732019#4732019 – Kartikeya Khosla Aug 09 '14 at 17:08