I have this normal MVC form on a page which i load using a Partial View.
When the form is submitted I perform some backend logic, and after I'm done I do:
return RedirectToCurrentUmbracoPage()
But now the form fields aren't cleared. All the old values are still there.
Is simple way for me to clear the fields?
Strange, the RedirectToCurrentUmbracoPage() should indeed perform a redirect and thus clear the form. I think we need a little more context here to get to the solution.
Can you paste the code for the controller method handling the post? :-)
MVC Form - how do I clear the fields on post?
I have this normal MVC form on a page which i load using a Partial View. When the form is submitted I perform some backend logic, and after I'm done I do:
But now the form fields aren't cleared. All the old values are still there. Is simple way for me to clear the fields?
Hi Mathias,
Strange, the
RedirectToCurrentUmbracoPage()
should indeed perform a redirect and thus clear the form. I think we need a little more context here to get to the solution.Can you paste the code for the controller method handling the post? :-)
Thanks in advance.
All the best,
Bo
Ah, I see now that I've been using:
I'm gonna try and change to RedirectToCurrentUmbracoPage() and see if that works
That solved it :)
is working on a reply...