Creating an MVC controller and a related view
Let's add a default controller by opening the context menu on our MVC web application and then navigating to Add | Scaffold…. From there, let's select the MVC 5 Controller – Empty option and give it a name, as shown in the following screenshot:
Our controller will have an Index()
method; for our recipes, we'll just need to add a view for that method in the same way we would do for every other controller action (we'll name it index.cshtml
), as shown in the following screenshot:
Visual Studio will create the ...
Get SignalR Real-time Application Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.