c# - Why does VS2015RC says "The ViewBag doesn't exist in the current context", where as VS2013 says no errors? -


i opening same mvc solution in vs2013 , vs2015rc, exact same code, vs2015rc tells me there bunch of errors on .cshtml pages vs2013 says no errors. main problem don't intellisense because of errors in vs2015.

what causing this? also, when build solution in vs2015, says succeeded? code snippet:

<!doctype html>  <html> <head>     <title>@viewbag.title</title>     <link href="@url.content("~/content/site.css")" rel="stylesheet" type="text/css" />     <script src="@url.content("~/scripts/jquery-2.1.3.min.js")" type="text/javascript"></script>     <meta name="description" content="the description of page" />     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body>     <div id="header">         <div class="title">abc</div>     </div>     <div id="categories">         @{ html.renderaction("menu", "navigation"); }     </div>     <div id="content">         @renderbody()     </div> </body> </html> 

vs2013enter image description here vs2015enter image description here

try add line inside each .cshtml

@inherits system.web.mvc.webviewpage<dynamic> 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -