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

  1. create display template named myclass.cshtml under displaytemplates folder

  2. add "str" inside template

  3. call displayformodel without parameter (given model in current view same myclass)

if have misunderstood please point out


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -