how to maintain viewstate?
-
I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){ window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?
-
I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){ window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?
I remember answering the very same question just a few days ago. Anyway, all you need to do is redirect to the details page from the client and not the server. If you do so your search results will be intact when you traverse back via history.back to the search page. HTH!
-
I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){ window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?
Dont ever use
history.back
crap from your web site. Rather always go for an AJAX call, or full postback for your back button. I always like to disable that back button in the browser. It is very old concept to maintain the history. ;)Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->****
InfoBox Visual Studio 2010 Extension
Windows7 API Code Pack
Simplify Code Using NDepend** -
I remember answering the very same question just a few days ago. Anyway, all you need to do is redirect to the details page from the client and not the server. If you do so your search results will be intact when you traverse back via history.back to the search page. HTH!
-
Dont ever use
history.back
crap from your web site. Rather always go for an AJAX call, or full postback for your back button. I always like to disable that back button in the browser. It is very old concept to maintain the history. ;)Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->****
InfoBox Visual Studio 2010 Extension
Windows7 API Code Pack
Simplify Code Using NDepend** -
plz, give me more details, How redirect page? I don't know much about serverside redirection n clientside Rt now i redirect page using response.redirect
When you use Response.Redirect from an event handler in the code behind it is called Server redirection. When you use links or window.location from the HTML then it is called Client redirection. It is not straight forward to change server redirect to client redirect as it might involve a good amount of behavioral changes, but in most cases it would be a simple code change. The crux here is that you would have to generate the redirect URL, the one you use in the Response.Redirect on the server event on the button click, when you generate the search result and make it available as a HTML hyperlink for the user to click and navigate. Hope I make sense to you.
-
I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){ window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?
You can cache your all search page details into a cache and repopulate the search page when you come back from cache... Thanks
-
When you use Response.Redirect from an event handler in the code behind it is called Server redirection. When you use links or window.location from the HTML then it is called Client redirection. It is not straight forward to change server redirect to client redirect as it might involve a good amount of behavioral changes, but in most cases it would be a simple code change. The crux here is that you would have to generate the redirect URL, the one you use in the Response.Redirect on the server event on the button click, when you generate the search result and make it available as a HTML hyperlink for the user to click and navigate. Hope I make sense to you.
-
You can cache your all search page details into a cache and repopulate the search page when you come back from cache... Thanks