Reputation: 19
I'm using Visual Studio for Mac to build a .net core MVC project, but I can't create views. How can I create a View
from a Controller
, and how can I use a layout for this view?
Upvotes: 1
Views: 5391
Reputation: 21
It actually isn't that bad - you can go to the Views directory and find the folder for the controller you want the view for. Right-click on the controller directory and use the "add scaffold" option to create a view with templated code.
See below.
Add Scaffolded View in Visual Studio for Mac:
Upvotes: 2
Reputation: 2747
On ASP.Net Core not exist that function so you need to create views "by hand"
For more i reccomend to read from official docs Adding a view to an ASP.NET Core MVC app
Upvotes: 1