Pookye
Pookye

Reputation: 89

MVC 4 : Back to previous page and keep search results

Sorry if this question has already been asked before but I couldn't find the answer so far.

I have 2 partial views updated according to searches results and from which I can access one "details" page. On that page, I have a "Back to previous page" action link (that I found here: How do I redirect to the previous action in ASP.NET MVC?):

@Html.ActionLink("Back to previous page", null, null, null, new { href = Request.UrlReferrer})

The thing is that I need to redirect to the previous page but keep the results of the search I made on it. Is there any best practices to do that? Any help or even hint is appreciated :) Thanks!

Upvotes: 0

Views: 3832

Answers (1)

Pookye
Pookye

Reputation: 89

For those interested:

@Html.ActionLink("Back to previous page", null, null, null, new { onclick = "history.go(-1);"})

The answer proposed in the post Onclick javascript to make browser go back to previous page? was given with the input tag.

Upvotes: 1

Related Questions