asp.net mvc - UIHint not working under model DisplayTemplate -
i have model mymodel
public class mymodel { [uihint("str")] public string name {get;set;} }
in view, rendering model using
@html.displayformodel("sometemplate")
so, model using sometemplate displaytemplate.
so uihint not being rendered in sometemplate.
is there solution render uihint in displaytemplate or not possible @ all,
you have inconsistancies in code.
first, uihint used define name of display template render given property, , not add string in rendered output.
second, parameter displayformodel not name of display template (it selected automatically based on convention name of model, or defined using uihint)
so is: assuming model class named myclass
create display template named myclass.cshtml under displaytemplates folder
add "str" inside template
call displayformodel without parameter (given model in current view same myclass)
if have misunderstood please point out
Comments
Post a Comment