开发者

Automatically create dropdown with EditorForModel()

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜