开发者

ASP.NET Forms automation/serialization/binding

开发者 https://www.devze.com 2023-01-01 17:49 出处:网络
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).

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:

  1. Have layout stored in DB (in XML). Layout must support several columns, tabbed interface
  2. Automatically bind business object values to the form
  3. Automatically read form values and write to business object
  4. Must support automatic validation
  5. 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.

0

精彩评论

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