Is there any good reason to use FormCollection instead of ViewModel?

前端 未结 11 1582
离开以前
离开以前 2020-11-27 15:09

I\'ve inherited a code base written in ASP.Net MVC 4. Every post method takes a FormCollection. Aside from annoyance of having to access the values through quot

11条回答
  •  醉话见心
    2020-11-27 15:26

    You can always add the form collection properties to your method signatures. They will automatically be populated by form values with corresponding keys.

提交回复
热议问题