Hi TR,
The problem you're dealing with is a facet of the WebForm object model. As a
WebForm posts back to itself, and the Referer is the last page visited, the
Referer is as likely to be the same page as it is to be another.
The solution is to keep track of the Referer (persist it in ViewState, most
likely) after the first time the page is visited. This can be done using a
conditional statement to check if the Referer's URL is the same as the
current page, and only saving it if it is not.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
"TR" <TR@nowhere.biz> wrote in message
news:OF**************@TK2MSFTNGP09.phx.gbl...
In an "Abandon Changes" button on my UserPreferences.aspx form, I'd like
to
redirect back to the page the user was on before coming to the
UserPreferences form. It could be any one of my web app's pages with a
link
to the UserPreferences page in its topmenu. (I'm testing for stale session
tokens and can prevent users from bookmarking the page.) However, in
codebehind for the AbandonChanges click event, the REFERRER is the
UserPreferences page itself, having posted to itself. Does asp.net keep
track of the "actual previous page" so to speak, when the previous page is
from the same web application? Or is that sort of state tracking up to the
developer?
Thanks