【发布时间】:2018-04-09 22:04:20
【问题描述】:
我有一个部分视图文件,它接收保存在视图目录之外的@model - 实际上存储在 app_data 中。
但是我得到错误:
The name 'model' does not exist in the current context
Source File: ...\app_data\_DefaultLayout.cshtml
下面是我的代码:
@Html.Partial("~/app_data/_DefaultLayout.cshtml"), Model)
默认布局如下:
@using System.Web.Mvc
@using System.Web.Mvc.Html
@model MyApp.ViewModels.CreateCaseViewModel
// some html and razor code
【问题讨论】:
标签: asp.net asp.net-mvc asp.net-mvc-4 razor