473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Need C# function for javascript function Browser.History.Back

Hi,
I need (in one function in aspx page) return the WWW browser back to
previous page.
How can I do it?

Thanks
Nov 16 '05 #1
2 10997
I wouldn't have thought you could do that from code as the Back
functionality uses the browsers history. I suppose you could set your ASPX
page to run a javascript function once its loaded that calls
Browser.History.Back????

MattC

"Luboš Šlapák" <lu**********@centrum.cz> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...
Hi,
I need (in one function in aspx page) return the WWW browser back to
previous page.
How can I do it?

Thanks

Nov 16 '05 #2
Hi LuboOne,
For a serverside "Back"-function use:
Response.Redirect(Request.Referrer.AbsoluteUri);

This only works if it isn't a postback. If your page does postbacks use:
if(!IsPostBack)
{
ViewState.Add("ref",Request.UrlReferrer.AbsoluteUr i);
}

....in page load, and the do:
Response.Redirect((string)ViewState["ref"]);

....when you want to go back.

/Hugo

On Mon, 13 Sep 2004 14:30:17 +0200, Luboš Šlapák wrote:
Hi,
I need (in one function in aspx page) return the WWW browser back to
previous page.
How can I do it?

Thanks

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" ...
4
by: Larry Kahm | last post by:
Is there a PHP equivalent to the javascript statement history.go(-1)? Thanks! Larry
1
by: Jenny | last post by:
Need urgent help for an unsolved problem. In our ASP web application, we creat a Back button and if user click on this button, it execute history.go(-1) to go back to the previous page. All our...
3
by: woodsie | last post by:
i'm looking for a back script that will work in Safari (on mac). the one below works fine in IE and netscape but not safari. <a href="#" onClick="history.go(-1)">go back</a> any help plz?
17
by: Ian | last post by:
Hi there, Can anybody tell me where I can find a standards documents like you have in c#. I am trying to write javascript and would like to know what standards are i.e. Where to put the...
4
by: Food Groupy | last post by:
Hi... I use a function something like this, <a href="javascript:history.back();">Return to original page</a> to give people a "back" option sometimes on pages. Is there any way of...
3
by: Jake | last post by:
Im using some custom javascript:history.forward() & javascript:history.back() image buttons on my application. If there is no back or forward history, I would like to display a dimmed(disabled...
5
by: bbxrider | last post by:
is it possible to mimic/invoke a browsers 'back' function, so the user could click a link/button/etc right on the page instead of being directed to 'use the browsers back button' if not html then...
4
by: =?Utf-8?B?QVJUTUlD?= | last post by:
i have a back button inside the code i have the following: Response.Redirect("javaScript:history.go(-1)"); I can't get the thing to work like i want it to, i want the user to click the button...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.