Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is my "Create strongly-typed view" menu option in MVC 5 Visual Studio 2013

I am starting to create MVC 5 applications. But in controller, right click inside Create action method, select Create View. Menu comes up, where I can select model, etc., but there is no longer an option to select "Create strongly-typed view". See screenshot below

Screen shot

like image 919
ceci Avatar asked Feb 05 '15 16:02

ceci


People also ask

What is strongly typed view in MVC view created with?

cshtml View: In order to create a strongly typed view in ASP.NET MVC Application, we need to specify the model type within the view by using the @model directive.

What is strongly typed view in MVC?

What is Strongly Typed View. The view which binds to a specific type of ViewModel is called as Strongly Typed View. By specifying the model, the Visual studio provides the intellisense and compile time checking of type. We learnt how to pass data from Controller to View in this tutorial.


2 Answers

Hi MVC3/ or Visual Studio 2015 does not give option to select 'Strongly typed view', instead following steps need to carry out to implement strongly typed views.

Build your project before starting following steps so that you will get model in the list to select as strongly type.

  1. Right click on the controller to generate view.

enter image description here

  1. By default you will see following screen

enter image description here

  1. Change options from Template : Empty (without model) to 'Empty' like below

enter image description here

  1. This will allow you to choose your 'Strongly typed' View.

enter image description here

  1. When View is created it will look like following

enter image description here

Let me know in case of any queries.

like image 81
Pratima Avatar answered Oct 13 '22 00:10

Pratima


VS2013 changed the language a bit. To create "strongly typed" view, trigger the create a view dialog and choose any template other than "Empty (without model)". You should now be able to choose your Model from the "Model Class" dropdown. Doing this will create the equivalent of a strongly typed view.

like image 24
misterbwong Avatar answered Oct 12 '22 23:10

misterbwong