August 2018
Intermediate to advanced
298 pages
5h 33m
English
So far, we were returning a simple string from the controller. Although that explains the concept of how the Controller and action methods works, it is not of much practical use.
Let's create a new action method named, Index2:
public IActionResult Index2(){ return View(); // View for this 'Index2' action method}
Now, we have created the action method that returns a view, but we have still not added the view. By convention, ASP.NET MVC would try to search for our view in the Views\{ControllerName}\{ActionMethod.cshtml} folder. With respect to the preceding example, it will try to search for Views\Home\Index2.cshtml. Please note that the name of the controller folder is Home, not ...
Read now
Unlock full access