Adding new .cshtml view to Visual Studio solution
I'm trying to add a new WebPage.cshtml view to my VS solution, but when I
compile/run my solution (F5) on my localhost, the view is empty. It's just
a simple HTML page. Why is it empty?
I'm new to MVC development and so I suspect that I am missing an important
concept related to how Models, Controllers, and Views work together to
produce the view, however, I've read about it enough that I understand the
basic concept of each.
I've been playing around with the controller and am guessing that I need
something like the following before the view will work:
public ActionResult WebPage()
{
return View();
}
Is that correct?
What other pieces to the puzzle am I missing?
No comments:
Post a Comment