Up vote 1 down vote favorite share g+ share fb share tw.
Implement a link back to a search result page from one of its clicked on results. What I am trying to do is pass a search query via a back link and to display the result in a view and then run the search query auto. @Html.
ActionLink("Back to List", "Index", new { searchString= TempData"lastSearchString" } ) I am having trouble trying to implement this concept . C# asp.net" rel="nofollow">asp.net asp.net" rel="nofollow">asp.net-mvc-3 razor link|improve this question edited Jan 12 at 0:55 asked Dec 26 '11 at 23:36Daza Aza1346 72% accept rate.
As long as there is a controller parameter called query, and the ViewBag. Query is a valid query string, this should be working. Which part is breaking down?
– David C Dec 27 '11 at 2:10.
This should retain the search results and text entered. Not sure if it works on all browsers however.
Page) { tempdata"lastSearchString"=searchString; } in your view @Html. ActionLink("Back to List", "Index", new { searchString= tempdata"lastSearchString" } ).
Thanks for your reply - the code puts the search result, back in the search box after you go back to the index view - However does not redisplay the search result. – Daza Aza Dec 28 '11 at 21:09 that's why, you should not use java script go-back, use action-link like I posted, if you still have problem, paste your view here, so that I can look at it. – HaBo Dec 28 '11 at 22:20.
You could implement it using Session variables or by storing a cookie.
Is there away to implement it without session variables or by storing a cookie. – Daza Aza Dec 27 '11 at 0:05 I have tryed session state before but had no luck. – Daza Aza Dec 27 '11 at 0:06.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.