Question

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

et quand je fais

Html.Input(o => o.AreaId) il cherche en fait la Guid.aspx au lieu de chercher My.aspx de \ vues \ partagé

Était-ce utile?

La solution 3

Je suis passé à 2 Mvc Templated Helpers , maintenant il fonctionne

Autres conseils

Le problème semble provenir du fait que la propriété Areaid est de type object. Par exemple, si vous changez pour string il fonctionne très bien.

Je suppose que le fichier Mon doit être .ascx et non .aspx . Il ne fonctionne pas?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top