I need to implement many forms in ASP.NET application (for IRS mostly). There are will be a lot of standard controls for each form (textb开发者_StackOverflow中文版oxes, dropdowns, checkboxes, radio). And business entity assigned to each.
What's the best solution to automate this process? I need to:
- Have layout stored in DB (in XML). Layout must support several columns, tabbed interface
- Automatically bind business object values to the form
- Automatically read form values and write to business object
- Must support automatic validation
- Some basic workflows support would be good
I used to work with TFS and saw how they implemented WorkItem templates (.wit files). In general this is all I need. But what framework did they build it on? How can I utilize this solution?
I know about Dynamic Data only: http://www.asp.net/dynamicdata
Have you looked into asp.net mvc? You create your business entities and model bind to a form. The form is auto-generated based on the model's properties data types, as well as any additional attributes you assign to a given property.
Otherwise, you would need to create a mechanism that loads the XML data from the database, create an instance of a given control, assign values to the control's properties, then add the control to the form's control collection. Once thats done, you will need a mechanism that maps the fields on the form to and from the data objects properties, preferably by a naming convention. Then do whatever processing you need to do to the data. Though I would encourage you to make use of ajax and partial page updating to prevent complete page reloads on each and every httprequest.
精彩评论