For another, less elegant solution, imagine a site with a โWizard-likeโ page structure (Views), where you want to transfer the ViewModel from page 1 to page 2, from Page 2 to page 3, etc.
The problem is that the GET version must get the model from page 1, but it must also pass the model to perform a postback. Therefore, both the GET and POST versions of any "medium" pages need a signature that contains the model.
The workaround is to simply add the "junk email parameter" to the signature, making sure it is NULL using the parameter.
[HttpGet] public ActionResult Page2(MyModel myModel) { } [HttpPost] public ActionResult Page2(MyModel myModel, int? i) { }
source share