Solved

go back to the previous page with the same stage

Posted on 2006-06-30
6
247 Views
Last Modified: 2008-02-01
I was using java script to go back to the previous page. <a href="javascript:history.back()">Go Back to Previous Page</a>

But,if there is a postback ( update record) on the current page, it won't work..

I need to go back to the specific page ( queue.aspx)  with the same stage.
Ont he queue.aspx page , you can query a gridview and go to the detailpage.

On the detail page, I have can go back to the previous page by using above Java script.however,  If there are postbacks ( like update record) on the detail page, the java script won;t work, because it will take you to the previous stage, not the queue.aspx page with the same query result in gridview.


It seems like i need to session variables... Any idea?

0
Comment
Question by:jung1975
6 Comments
 
LVL 18

Accepted Solution

by:
Elvio Lujan earned 250 total points
ID: 17021091
you can go bak adding a postback in the link...

when page_load save in one session variable the previous page and in the back link press reditect to it
0
 

Author Comment

by:jung1975
ID: 17021141
can you show me some code examples?
0
 
LVL 5

Assisted Solution

by:vinodhsomasekharan
vinodhsomasekharan earned 250 total points
ID: 17023667
Hai,

Yes u can go for session variables which seems to be a better idea..
what u can try the following method in page_load event of  your pages..

If Not IsPostBack Then
           session("prevPageUrl") = Request.UrlReferrer.ToString
End If

and in the click event of u r GoBack button u can use this session value to navigate to the actual previous page..

Response.Redirect(session("prevPageUrl").ToString)

U can go for window.history()  function but its a tedious process to keep track of the postbacks and the actual call for this page..


Hope this helps u

Regards
Vinodh
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question