ASP.NET MVC Master Detail Entry Form

后端 未结 6 1219
野趣味
野趣味 2021-01-30 18:02

I’m trying to implement an order entry form using ASP.NET MVC but facing a lot of difficulties. All the samples that I found are related to viewing master detail forms, and non

6条回答
  •  星月不相逢
    2021-01-30 18:41

    Unlike WebForms, ASP.NET MVC does not try to hide the stateless nature of HTTP. To work with a complex object across multiple forms you have a couple of options:

    • Save the object on the server with each change so that the updated object is available using only an id
    • Use jquery to populate the order line form and save details to the main form

    I usually go with the client side option myself, with the main form having hidden fields for the data that will be edited in the subform. You may find the server side option easier though - if you really don't want to involve the database you can keep your partially updated object in the session.

提交回复
热议问题