Serhat Yılmaz
Serhat Yılmaz

Reputation: 19

I can't add view to .Net Core MVC Project at Visual Studio for Mac

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?

HomeController

Upvotes: 1

Views: 5391

Answers (2)

Rachael Thompson
Rachael Thompson

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: Add Scaffolded View in Visual Studio for Mac

Upvotes: 2

J. Doe
J. Doe

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

Related Questions