Pergunta

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<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>

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

Foi útil?

Solução 3

I switched to mvc 2 Templated Helpers, now it works

Outras dicas

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?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top