Reputation: 355
I am brand new to ASP.NET - and was following some tutorials. below are the screen shots that show what i have done exactly as recommended and in turn it worked for them, but for some reason i keep getting this error and have no idea what to - I am using MVC5 on VS Community : Could someone help me figure out where I have gone wrong? I do not even know where to begin :(
Upvotes: 1
Views: 108
Reputation: 5117
You have referenced _ViewStart.cshtml
file and that's not correct. This file and it's name has a special meaning to MVC framework. You cannot specify it, it is picked up internally by framework.
_BasicLayout.cshtml
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
</head>
<body>
<div>@RenderBody()</div>
</body>
</html>
_ViewStart.cshtml
@{
Layout = "~/Views/_BasicLayout.cshtml";
}
Index.cshtml
@{
ViewBag.Title = "Index view does not need to reference _VewStart.cshtml explicitly";
}
Upvotes: 2