View not updating after post

前端 未结 3 1229
南方客
南方客 2020-12-01 07:33

I have a controller method CreateOrUpdate, this method is supposed to save the car to the database and then return as normal.

public ActionResult CreateOrUp         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 07:59

    I didn't want to clear the ModelState because I needed to display errors, so I went with

    ValueProviderResult vpr = new ValueProviderResult("", null, System.Globalization.CultureInfo.CurrentCulture);
    
    ModelState["id"].Value = vpr;
    

提交回复
热议问题