Returning user to previous page...

D

David Lozzi

Howdy,

I have a cancel button, I would like to send them to the previous page they
were on. For example, they are viewing a queue of tickets. They can click on
a ticket and update it if they wish, or view other information. When viewing
some of the other details, the page is reloaded to show and hide some
controls. If they click Cancel, I'd like to send them back to the queue.
Normally, I would simply do a response.redirect("queue.aspx"), but there are
other pages they could've come from, myqueue, find ticket, etc.

thanks!!!

david Lozzi
 
D

David Lozzi

The problem with that is the the back button will load the same page if
somethin posted back. basically i need to collect the referring page at
first load, then store it somewhere and use it when necessary. I guess store
it in a hidden text field?

Also, I read that Request.ServerVariables("HTTP_REFERER") only collects
pages when a <a> tag was used to reach the current page. Any idea on how to
collect the previous page is a response.redirect was used?

Thanks,
 
W

William F. Robertson, Jr.

On pages that need this "cancel" feature, I will place &ReturnUrl=page.aspx
in the querystring, then on the first page load, pull it off querystring and
store it in a hidden textfield. This way there are no Response.Redirect
problems, plus I can keep the querystring with the previous page and when I
cancel to it, it will have the querystring of the first page as well.

bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,124
Latest member
JuniorPell
Top