3

@model Webgrid.Models.Employee

上述代码在 ASPX 中的语法是什么

4

1 回答 1

2

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>" %>
于 2013-01-16T12:06:13.647 回答