Solved

go back to the previous page with the same stage

Posted on 2006-06-30
6
237 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:
lem2802 earned 250 total points
Comment Utility
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
Comment Utility
can you show me some code examples?
0
 
LVL 5

Assisted Solution

by:vinodhsomasekharan
vinodhsomasekharan earned 250 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

11 Experts available now in Live!

Get 1:1 Help Now