<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IPagedList<Product>>" %>
怎么把Inherits="System.Web.Mvc.ViewPage<IPagedList<Product>>这句用razor语法写出来。急 啊.....
在*.cshtml的第一行写上:
@inherits System.Web.Mvc.ViewPage<IPagedList<Product>>
如果采用Area隔离的话,一般是写@inherits System.Web.Mvc.WebViewPage
@model MyMvcProj.Models.Product
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
这个_Layout相当于你那个Site.Master