我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

时间:2022-11-22 22:53:06

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

我开始创建MVC 5应用程序。但在控制器中,右键单击Create action方法,选择Create View。菜单出现,我可以选择模型等,但不再有选择“创建强类型视图”的选项。见下面的截图

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

2 个解决方案

#1


12  

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.

嗨,MVC3 /或Visual Studio 2015不提供选择“强类型视图”的选项,而是按照需要执行强类型视图的步骤。

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.
  2. 右键单击控制器以生成视图。

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. By default you will see following screen
  2. 默认情况下,您将看到以下屏幕

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. Change options from Template : Empty (without model) to 'Empty' like below
  2. 将模板:清空(无模型)中的选项更改为“清空”,如下所示

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. This will allow you to choose your 'Strongly typed' View.
  2. 这将允许您选择“强类型”视图。

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. When View is created it will look like following
  2. 创建视图时,它将如下所示

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

Let me know in case of any queries.

如有任何疑问,请告诉我。

#2


3  

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.

VS2013改变了语言。要创建“强类型”视图,请触发创建视图对话框并选择“清空(无模型)”以外的任何模板。您现在应该可以从“模型类”下拉列表中选择您的模型。执行此操作将创建强类型视图的等效项。

#1


12  

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.

嗨,MVC3 /或Visual Studio 2015不提供选择“强类型视图”的选项,而是按照需要执行强类型视图的步骤。

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.
  2. 右键单击控制器以生成视图。

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. By default you will see following screen
  2. 默认情况下,您将看到以下屏幕

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. Change options from Template : Empty (without model) to 'Empty' like below
  2. 将模板:清空(无模型)中的选项更改为“清空”,如下所示

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. This will allow you to choose your 'Strongly typed' View.
  2. 这将允许您选择“强类型”视图。

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

  1. When View is created it will look like following
  2. 创建视图时,它将如下所示

我在MVC 5 Visual Studio 2013中的“创建强类型视图”菜单选项在哪里

Let me know in case of any queries.

如有任何疑问,请告诉我。

#2


3  

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.

VS2013改变了语言。要创建“强类型”视图,请触发创建视图对话框并选择“清空(无模型)”以外的任何模板。您现在应该可以从“模型类”下拉列表中选择您的模型。执行此操作将创建强类型视图的等效项。