|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
return url valueHi;
I have a page (page X) where I want to have a "Return" button and that takes it back to the previous page (page A) - the one (page A) that linked to this page (page X). Is there an easy way to get the url of page A when page X first loads? Hi dave,
Thanks for your post! Normally, this is controlled by client side javascript code. We can use history.go(-1) statement to implement go back function. Like below: <script> function goback() { history.go(-1); } </script> <a href="javascript:goback()">Back</a> Hope this helps! Best regards, Jeffrey Tan Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Hi;
I have a situation like the login page where I may have to go to a second page before I go back. Is there a way to get the url? Show quoteHide quote > Hi dave, > > Thanks for your post! > > Normally, this is controlled by client side javascript code. We can use > history.go(-1) statement to implement go back function. Like below: > <script> > function goback() { > history.go(-1); > } > </script> > <a href="javascript:goback()">Back</a> > > Hope this helps! > > Best regards, > Jeffrey Tan > Microsoft Online Community Support > ================================================== > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > ================================================== > This posting is provided "AS IS" with no warranties, and confers no rights. > > I usually manage this scenario programmatically in my applications where i
maintain a session variable, e.g. Session["ReturnToURL"], which can be set by each page before redirecting the response to the next page. Then any page can use that variable when the user hits return to go back to the previous page. Show quoteHide quote "David Thielen" wrote: > Hi; > > I have a situation like the login page where I may have to go to a second > page before I go back. Is there a way to get the url? > > -- > thanks - dave > david_at_windward_dot_net > http://www.windwardreports.com > > > > ""Jeffrey Tan[MSFT]"" wrote: > > > Hi dave, > > > > Thanks for your post! > > > > Normally, this is controlled by client side javascript code. We can use > > history.go(-1) statement to implement go back function. Like below: > > <script> > > function goback() { > > history.go(-1); > > } > > </script> > > <a href="javascript:goback()">Back</a> > > > > Hope this helps! > > > > Best regards, > > Jeffrey Tan > > Microsoft Online Community Support > > ================================================== > > When responding to posts, please "Reply to Group" via your newsreader so > > that others may learn and benefit from your issue. > > ================================================== > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > Hi;
I've got it implemented where it looks for file.aspx?returnurl=orig.aspx and that is working nicely. I just wondered if that was already a session variable somewhere set by ASP. Show quoteHide quote "Phillip Williams" wrote: > I usually manage this scenario programmatically in my applications where i > maintain a session variable, e.g. Session["ReturnToURL"], which can be set by > each page before redirecting the response to the next page. Then any page > can use that variable when the user hits return to go back to the previous > page. > -- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "David Thielen" wrote: > > > Hi; > > > > I have a situation like the login page where I may have to go to a second > > page before I go back. Is there a way to get the url? > > > > -- > > thanks - dave > > david_at_windward_dot_net > > http://www.windwardreports.com > > > > > > > > ""Jeffrey Tan[MSFT]"" wrote: > > > > > Hi dave, > > > > > > Thanks for your post! > > > > > > Normally, this is controlled by client side javascript code. We can use > > > history.go(-1) statement to implement go back function. Like below: > > > <script> > > > function goback() { > > > history.go(-1); > > > } > > > </script> > > > <a href="javascript:goback()">Back</a> > > > > > > Hope this helps! > > > > > > Best regards, > > > Jeffrey Tan > > > Microsoft Online Community Support > > > ================================================== > > > When responding to posts, please "Reply to Group" via your newsreader so > > > that others may learn and benefit from your issue. > > > ================================================== > > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > > > This works for me:
Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) If Not Page.IsPostBack Then ' Save the referrer Url ViewState("ReferrerUrl") = Request.UrlReferrer.ToString() End If End Sub Protected Sub BackButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Redirect(ViewState("ReferrerUrl").ToString()) End Sub Show quoteHide quote "David Thielen" <thielen@nospam.nospam> wrote in message news:E46C4476-6AAA-4E2B-BCFC-7495BEEED088@microsoft.com... > Hi; > > I've got it implemented where it looks for file.aspx?returnurl=orig.aspx > and > that is working nicely. I just wondered if that was already a session > variable somewhere set by ASP. > > -- > thanks - dave > david_at_windward_dot_net > http://www.windwardreports.com > > > > "Phillip Williams" wrote: > >> I usually manage this scenario programmatically in my applications where >> i >> maintain a session variable, e.g. Session["ReturnToURL"], which can be >> set by >> each page before redirecting the response to the next page. Then any >> page >> can use that variable when the user hits return to go back to the >> previous >> page. >> -- >> HTH, >> Phillip Williams >> http://www.societopia.net >> http://www.webswapp.com >> >> >> "David Thielen" wrote: >> >> > Hi; >> > >> > I have a situation like the login page where I may have to go to a >> > second >> > page before I go back. Is there a way to get the url? >> > >> > -- >> > thanks - dave >> > david_at_windward_dot_net >> > http://www.windwardreports.com >> > >> > >> > >> > ""Jeffrey Tan[MSFT]"" wrote: >> > >> > > Hi dave, >> > > >> > > Thanks for your post! >> > > >> > > Normally, this is controlled by client side javascript code. We can >> > > use >> > > history.go(-1) statement to implement go back function. Like below: >> > > <script> >> > > function goback() { >> > > history.go(-1); >> > > } >> > > </script> >> > > <a href="javascript:goback()">Back</a> >> > > >> > > Hope this helps! >> > > >> > > Best regards, >> > > Jeffrey Tan >> > > Microsoft Online Community Support >> > > ================================================== >> > > When responding to posts, please "Reply to Group" via your newsreader >> > > so >> > > that others may learn and benefit from your issue. >> > > ================================================== >> > > This posting is provided "AS IS" with no warranties, and confers no >> > > rights. >> > > >> > > |
|||||||||||||||||||||||