@model Webgrid.Models.Employee
上述代码在 ASPX 中的语法是什么
The strongly typed views need to derive from System.Web.Mvc.ViewPage<T>
where T
is your model type:
<%@ Page Language="C#"
Inherits="System.Web.Mvc.ViewPage<Webgrid.Models.Employee>" %>
Or if you are having an ascx
page then from System.Web.Mvc.ViewUserControl<T>
<%@ Control Language="C#"
Inherits="System.Web.Mvc.ViewUserControl<Webgrid.Models.Employee>" %>