With MVC, I hear that it's good practice to get back to a 'GET' action by using RedirectToAction after processing the Http postback. I understand this is so the postback is not repeated should the user refresh the page or bookmark and revisit it. I think that is sensible but after开发者_开发技巧 the redirect the model errors are lost so I can't display them using Html.ValidationSummary. What is the recommended practice in this scenario? Many thanks
You shouldn't allow to redirect before errors are displayed. In fact, all logic happens before redirect - insert new data, check data, display errors, correct data, save data, redirect, insert new data.
精彩评论