Facing Problem In Partial View

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
When I am adding partial view in my widget plugin and calling it in configure.cshtml it shows an error-
The partial view '_ConfigureForm' was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/DefaultClean/Views/WidgetsHtml/_ConfigureForm.cshtml
~/Themes/DefaultClean/Views/Shared/_ConfigureForm.cshtml
~/Views/WidgetsHtml/_ConfigureForm.cshtml
~/Views/Shared/_ConfigureForm.cshtml
~/Administration/Views/WidgetsHtml/_ConfigureForm.cshtml
~/Administration/Views/Shared/_ConfigureForm.cshtml
I am using nopcommerce 3.7 so please help me how to resolve this problem ?
7 years ago
The easiest solution is place the partial view where the application is searching.If you do not want to do this then at view where you initialize the partial view change it like

@Html.Partial("~/Plugins/Misc.AvenirTelecom/Views/AvenirTelecomView/_ChoiceModal.cshtml")(@Html.Partial("~/Plugins/PluginName/Views/Innerfolderofview/_YourPartialView.cshtml")).

Or at controller side

return PartialView("~/Plugins/Misc.AvenirTelecom/Views/AvenirTelecomView/PluginProductTemplate.Simple.cshtml",model);
7 years ago
Thanks a lot for your help It works fine now..
7 years ago
harshitporwal wrote:
When I am adding partial view in my widget plugin and calling it in configure.cshtml it shows an error-
The partial view '_ConfigureForm' was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/DefaultClean/Views/WidgetsHtml/_ConfigureForm.cshtml
~/Themes/DefaultClean/Views/Shared/_ConfigureForm.cshtml
~/Views/WidgetsHtml/_ConfigureForm.cshtml
~/Views/Shared/_ConfigureForm.cshtml
~/Administration/Views/WidgetsHtml/_ConfigureForm.cshtml
~/Administration/Views/Shared/_ConfigureForm.cshtml
I am using nopcommerce 3.7 so please help me how to resolve this problem ?


One more thing, you need to set Build Action as Content and give path as sina.islam suggested. This will fix your issue.
6 years ago
sina.islam wrote:
The easiest solution is place the partial view where the application is searching.If you do not want to do this then at view where you initialize the partial view change it like

@Html.Partial("~/Plugins/Misc.AvenirTelecom/Views/AvenirTelecomView/_ChoiceModal.cshtml")(@Html.Partial("~/Plugins/PluginName/Views/Innerfolderofview/_YourPartialView.cshtml")).

Or at controller side

return PartialView("~/Plugins/Misc.AvenirTelecom/Views/AvenirTelecomView/PluginProductTemplate.Simple.cshtml",model);


Hello Sina.

I am also having this problem.  I used the method that you suggest here, but it is still not working.  I am getting this error:

The partial view '~/Plugins/Misc.LakesideImport/Views/LakesideImport/_ImportProductFile.FileInput' was not found or no view engine supports the searched locations. The following locations were searched:
~/Plugins/Misc.LakesideImport/Views/LakesideImport/_ImportProductFile.FileInput


This is what I use to call the partial view:
@Html.Partial("~/Plugins/Misc.LakesideImport/Views/LakesideImport/_ImportProductFile.FileInput")

What I am puzzled over is, it says that it searched the location of where the view file is and it is there.  Here is a picture of my hard drive folder of where the Windows file explorer shows it.

I just cannot figure out why it is not finding the view file.

Any help that you can provide to resolve this issue would be gratefully appreciated.

Thanks,
Tony
6 years ago
Carneno wrote:

This is what I use to call the partial view:
@Html.Partial("~/Plugins/Misc.LakesideImport/Views/LakesideImport/_ImportProductFile.FileInput")



Hi Tony,

Could you please check, I think you forget to add extension of view, it should be    

@Html.Partial("~/Plugins/Misc.LakesideImport/Views/LakesideImport/_ImportProductFile.FileInput.cshtml")
6 years ago
Thanks Archer.

That fixed it.

I looked at numerous  @Html.Partial views in the solution and I don't remember any of them using the ".cshtml" extension.

I don't know why I need it there, but it does work.

Thanks,
Tony
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.