Reputation: 493
I started learning Asp.NET MVC and got stuck pretty immediately. According to all materials I have, after I add controller in MVC project (Template - empty MVC controller), corresponding view should be created, too (folder under Views). However, when I do this, nothing happens. Does anybody know what could be the problem? And will this cause me a problems in a long run? I guess I could create those files manually, but still would prefer if they were generated...
My system: Visual Studio Professional 2013, Update 5 Project: new MVC Web Application, template "Internet Application"
Thank you
Upvotes: 0
Views: 1773
Reputation: 3520
Other possible way is to add complete path of the view in your controller method which is returning a view.
public ActionResult Index()
{
return View("~/Views/Home/Index.cshtml");
}
this method is useful when you have a hierarchy of folders for view files.
Upvotes: 2
Reputation: 1718
Normally views aren't created when a new controller is added. Views can be generated with the following methods:
Upvotes: 1