Home > Mobile >  Add View option is not available in mvc?
Add View option is not available in mvc?

Time:09-18

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

CodePudding user response:

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.

CodePudding user response:

Basically You have 6 projects that is ApplicationComponent,ApplicationMapper,V3-MVC(Main Project),DataAccess,GenrateLabels and Logging,will click on main project then first unload it add the below code to csproject then reload it and done below is the whole process.

  1. Right click on Project then Click Unload project.
  2. Open .csproject 3.Find the code (may be different): (ProjectTypeGuids) {E3E379DF-F4C6-4180-9B81-6769533ABE47}; {349c5851-65df-11da-9384-00065b846f21}; {fae04ec0-301f-11d3-bf4b-00c04f79efbc} (ProjectTypeGuids)

4.Add the section After first Curly Braces {E3E379DF-F4C6-4180-9B81-6769533ABE47};

5.Then go to Project right click on it then again load the project and Done.

  • Related