ASP.NET MVC posted file model binding when parameter is Model

前端 未结 4 1301
粉色の甜心
粉色の甜心 2020-12-02 18:46

Is there any way to get posted files () to take part in model binding in ASP.NET MVC without manually looking at the reques

4条回答
  •  無奈伤痛
    2020-12-02 19:40

    Another way is to add a hidden field with the same name as the input:

    
    

    The DefaultModelBinder will then see a field and create the correct binder.

提交回复
热议问题