2

I'm developing nopcommerce plugin and calling partial view in master page. but loaded show this error:

CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Patial' and no extension method 'Patial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76
Hassan Abbas
  • 467
  • 2
  • 8
  • 28

2 Answers2

1

It looks like you have a typo. You're using @Html.Patial("myview") instead of @Html.Partial("myview")

Ricardo Reyna
  • 574
  • 6
  • 15
  • Yes, this could be the issue. – Divyang Desai Sep 26 '16 at 08:16
  • and also exception throw this An exception of type 'System.InvalidOperationException' occurred in System.Web.Mvc.dll but was not handled in user code – Hassan Abbas Sep 26 '16 at 08:20
  • Did you copy and paste your error or type it yourself? It has the term `'Patial'` twice – Ricardo Reyna Sep 26 '16 at 08:21
  • also view show this The partial view 'vendorProfile' was not found or no view engine supports the searched locations. The following locations were searched: – Hassan Abbas Sep 26 '16 at 08:23
  • The partial view 'vendorProfile' was not found or no view engine supports the searched locations. The following locations were searched: ~/Themes/twigoh/Views/Dashboard/vendorProfile.cshtml ~/Themes/twigoh/Views/Shared/vendorProfile.cshtml ~/Views/Dashboard/vendorProfile.cshtml ~/Views/Shared/vendorProfile.cshtml ~/Administration/Views/Dashboard/vendorProfile.cshtml ~/Administration/Views/Shared/vendorProfile.cshtml – Hassan Abbas Sep 26 '16 at 08:24
  • Is vendorProfile.cshtml located at any of those locations? If not, you should put it in one of those locations, or you can try following this question to specify a custom location: http://stackoverflow.com/questions/632964/can-i-specify-a-custom-location-to-search-for-views-in-asp-net-mvc – Ricardo Reyna Sep 26 '16 at 08:27
1

As per comment you got an error of:

The partial view 'vendorProfile' was not found or no view engine supports the searched locations. The following locations were

Which means it searched on location where it can not find the view called "vendorProfile" so put that view to ~/Themes/twigoh/Views/Dashboard/ or you can return partial view from your plugin like:

PartialView("~/Plugins/Twigoh.Sellers/Views/Dashboard/vendor‌​Profile.cshtml", model);

but when loaded in master view its show an error because it's try to find in shared folder but not get that view. So,rather than call @Html.Partial use @Html.RenderAction or else copy that view to shared folder.

Hope this helps!

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76