Why ASP.NET MVC default Model Binder is slow? It's taking a long time to do its work

后端 未结 3 659
心在旅途
心在旅途 2020-12-08 08:13

In a current project the client asked for the possibility of answering a questionnaire in two ways: using a Wizard (one question at a time) and Listing

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 09:06

    This may not be the answer you are looking for, but it may help. Instead of using the FormCollection, try having a controller method accept a model in the signature and use a Ajax.BeginForm(). This will remove the need for the serialization, and allow MVC to do it's work. Also, having a model with List of type Question may be worth looking into. This approach will also seemingly remove the need to iterate through the values on the post as they will already be in the model.

提交回复
热议问题