my viewmodel
public class CaseCreateInput
{
[PartialView("My")]
public object AreaId { get; set; }
}
My.aspx partialview
<%@ Page Title="" Language="C#" MasterPageFile="Field.Master"
Inherits="System.Web.Mvc.ViewPage<Pr开发者_如何学编程opertyViewModel<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>
and when I do
Html.Input(o => o.AreaId)
it's actually looking for the Guid.aspx instead of looking for My.aspx from \views\shared
The problem seems to be coming from the fact that the AreaId property is of type object
. For example if you change it to string
it works fine.
I guess that the file My must be .ascx and not .aspx. It doesn't?
I switched to mvc 2 Templated Helpers, now it works
精彩评论