The partial view 'ViewName' was not found or no view engine supports the searched locations

When trying to access a MVC Partial view which didnt exist in the existing view folder or the shared folder, I got the error below... I was trying to do this @Html.Partial("CandidateLogin")

Error Details:

The partial view 'CandidateLogin' was not found or no view engine supports the searched locations. The following locations were searched: ~/Media/Main/home/CandidateLogin.cshtml ~/Media/Main/home/CandidateLogin.vbhtml ~/Media/Main/Shared/CandidateLogin.cshtml ~/Media/Main/Shared/CandidateLogin.vbhtml Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The partial view 'CandidateLogin' was not found or no view engine supports the searched locations. The following locations were searched: ~/Media/Main/home/CandidateLogin.cshtml ~/Media/Main/home/CandidateLogin.vbhtml ~/Media/Main/Shared/CandidateLogin.cshtml ~/Media/Main/Shared/CandidateLogin.vbhtml

Solution:

If your MVC Partial view exists in a different folder, they are many ways to fix this but just provide the path of the view, see below. @Html.Partial("~/Media/Main/Partial/CandidateLogin.cshtml")   Cheers :)