Solved

go back to the previous page with the same stage

Posted on 2006-06-30
6
239 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 17

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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.…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now