How to create controls dynamically in MVC 3 based on an XML file

后端 未结 3 778
小蘑菇
小蘑菇 2020-11-28 21:04

I have a XML file stored in the database as XML format which contains some controls like drop down text box, label text area, etc. which may or may not have initial values.

3条回答
  •  天涯浪人
    2020-11-28 21:20

    you can pass a model to your strongly typed view andwrite a html helper named Html.ControlFor in the helper you can read the xml file and create controls (input, select etc.) based on match of property name (where property name matches property tag in xml file)

提交回复
热议问题