Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

VS Studio 2015 MVC the name viewbag does not exist in the current context

$
0
0

When I create a MVC project using MVC (VS2015) templae, it create and comnpiles and run ok, but when I go to the index view  I get the following error on the cshtml code

"the name viewbag does not exist in the current context"

@{
ViewBag.Title = "Home Page";
}

So how does cshtml can find those reference ?  the same happens with the "layout" inthe _ViewStart

Thanks


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>