Is there a way to go back to the previous page when a button (Cancel
button) is hot? It's an ASP control.
You mean "hit?" I will presume that the title is correct and that your
message has a typo.
It will be a little tricky, as we're dealing with an ASP.Net WebForm here,
and very likely, the "previous page" will be the same page (if it has posted
back) in your browser's history. What you would need to do is to keep track
of the "previous page" by storing it's URL (Request.UrlReferer) in ViewState
when the page is initially loaded, and only then. Thus, the URL of the
"previous page" will be persisted in ViewState across postbacks.
From there, it's a simple matter of handling the OnClick event of the
Control with a Response.Redirect to that URL.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.