2
votes

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?)

2
As per below comments, it search on location where it can not find the view called "vendorProfile" so put that view to ~/Themes/twigoh/Views/Dashboard/Divyang Desai
set the path of view return PartialView("~/Plugins/Twigoh.Sellers/Views/Dashboard/vendorProfile.cshtml", model); When i direct hit controller and action it works fine. but when loaded in master view its show error.Hassan Abbas
Why do you want to load that on master view?Divyang Desai
because this vendorProfile where show only avater and name of vendorHassan Abbas
now CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid argumentsHassan Abbas

2 Answers

1
votes

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!

1
votes

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