开发者

Automatically create dropdown with EditorForModel()

开发者 https://www.devze.com 2023-02-11 18:38 出处:网络
I have a model with a public IEnumerable<SelectListItem> Selections {get;set;} and one public string SelectedItem {get;set;}, how can I override the defaul开发者_开发问答t behavior in asp.net mv

I have a model with a public IEnumerable<SelectListItem> Selections {get;set;} and one public string SelectedItem {get;set;}, how can I override the defaul开发者_开发问答t behavior in asp.net mvc so it renders a dropdown for this property? I have a generic edit ui so I can't do things like Html.DropDownListFor(...


Take a look at custom templates: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-4-custom-object-templates.html

0

精彩评论

暂无评论...
验证码 换一张
取 消