Solved

go back to the previous page with the same stage

Posted on 2006-06-30
6
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 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