Warm tip: This article is reproduced from stackoverflow.com, please click
asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 spring-mvc

Add View option is not available in mvc?

发布于 2020-04-23 18:18:08

I want to add a view but that option is not seen after clicking on ActionResult, it shows only go to view option. suggest me how to do that what is happening with visual studio?

Thanks in advance.

enter image description here

Questioner
Parikshit
Viewed
13
C Murphy 2020-02-13 07:00

You don't necessarily need to create the view through that method, you can just create one via clicking on the subfolder within your views folder (in the solution explorer) that has the same name as your controller (i.e. in your case, it will likely be called "CPP_Reports"). Add new item, etc.

Creating a view in MVC

If your real concern is why you can't do so using the controller ActionResult, the only thing that I can think of is make sure your project setup is correct.

For instance, in MVC 5, you need to add a new scaffolded item to your project called "MVC 5 dependencies". Perhaps there is an update pending in your Nuget Package Manager for the MVC Runtime Assemblies.