How to clear fields after post back in asp.net mvc?
.net, asp.net-mvc, c#
Solution
Sounds like a job for the PRG (Post Redirect Get) pattern because you don't want the users to refresh the page and have it submit again.
To do this I would put a message or flag in your TempData so that you can inspect that when you redirect back to the original url to then display a message to the user.
Problem
I am wondering how do I clear fields after a postback in asp.net mvc? Like right now when validation errors occur the fields stay populated with whatever a user would entered. This is fine however, when no validation errors occur I want the all the fields to clear and a message to display. So right now I have the success displaying by using ViewData but not sure how to get the fields to clear.