Why does it show Views\Home\Index.cshtml by default?
It is defined in global.asax.cs.
If you change the route, initial page will show About View.
This is actually the mistake or misconception I have again and again. I was expecting to see the file Home/About.cshtml when I type in url, localhost/Home/About. No way.
What happen is, the url looks up HomeController.cs and About() function. Because it cannot find the function, it returns 'The resource cannot be found' error.
Just type in About() function as below for testing.
Voila! You are now looking at the view, View\About.cshtml.
RenderBody()
Good diagrams:
No comments:
Post a Comment