我的视图模型
public class CaseCreateInput
{
[PartialView("My")]
public object AreaId { get; set; }
}
My.aspx 部分视图
<%@ Page Title="" Language="C#" MasterPageFile="Field.Master"
Inherits="System.Web.Mvc.ViewPage<PropertyViewModel<object>>" %>
<%@ Import Namespace="MvcContrib.UI.InputBuilder.Views"%>
<asp:Content ID="Content1" ContentPlaceHolderID="Label" runat="server"><label for="<%=Model.Name%>"><%=Model.Label%></label></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Input" runat="server">
<%=Html.DropDownList(Model.Name,Model.Value as IEnumerable<SelectListItem>)%></asp:Content>
当我这样做的时候
Html.Input(o => o.AreaId)
它实际上是在寻找 Guid.aspx 而不是从 \views\shared 寻找 My.aspx