i am trying to render page layout in my index page in mvc project. here is the code:
_ViewStart.cshtml
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
index.cshtml
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
the _Layer.cshtml page exists in the given folder i.e is shared folder. but when i run the project i gives an error.
Server Error in '/' Application.
The layout page "~/View/Shared/_Layout.cshtml" could not be found at the following path: "~/View/Shared/_Layout.cshtml".
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.Web.HttpException: The layout page "~/View/Shared/_Layout.cshtml" could not be found at the following path: "~/View/Shared/_Layout.cshtml".
i have tried to use ~/shared/_Layout.cshtml syntax. but of use
Can somebody please tell me what i need to do.