ASP.NET MVC - using the same form to both create and edit

前端 未结 10 808
温柔的废话
温柔的废话 2021-01-30 05:27

Whats the best practice approach to creating a form that is used to both create new models and edit existing models?

Are there any tutorials that people can point me in

10条回答
  •  生来不讨喜
    2021-01-30 05:50

    If the entity has some kind of internal private key (e.g. an "id" member that is always > 0), you can use /Edit/0 instead of /Create

提交回复
热议问题