I have multiple pages containing the same partial view. The partial contains a form that posts to an action. After a post I want to return to the page I was on before the post. What’s the best way to do this?
Example:
Partial View:
form post action = note/create/
Pages
page1:
products/index/
page2:
customer/details/
page3:
order/details/
These 3 pages contain the partial view, when posting the partial it redirects to note/create/. I need to return to the original page on success.
Thanks
Simon
Either have the post happen via AJAX — thus not leaving the page, or pass the current controller/action/id (or the Url as a whole) as parameters to the action that handles the post. See below for an example of the later.
or