473,396 Members | 1,998 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,396 software developers and data experts.

Go back where I came from

When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

Thanks

Peter

Nov 19 '05 #1
6 1449
To determine if there is history exists ,Checkout Request.UrlReferrer

code would be like ,

if (Request.UrlReferrer == null )
//add javascript to the close button to navigate to "specific page"
else
//add javascript to the close button to do history.go(-1);
"Peter" wrote:
When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

Thanks

Peter

Nov 19 '05 #2
What version of ASP.NET are you using?
The answer Sreejith tried to give is incorrect.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Peter" <pc*****@online.nospam> wrote in message news:O6**************@tk2msftngp13.phx.gbl...
When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

Thanks

Peter

Nov 19 '05 #3
I am using .NET 1.1
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:ug**************@tk2msftngp13.phx.gbl...
What version of ASP.NET are you using?
The answer Sreejith tried to give is incorrect.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Peter" <pc*****@online.nospam> wrote in message news:O6**************@tk2msftngp13.phx.gbl...
When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

Thanks

Peter

Nov 19 '05 #4
I'm sorry, I see I failed to explain why I thought Sreejith was wrong.
Do you want to go back only one page or back to the homepage of the website?

<%= Clinton Gallagher

"Peter" <pc*****@online.nospam> wrote in message news:uz**************@TK2MSFTNGP14.phx.gbl...
I am using .NET 1.1
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:ug**************@tk2msftngp13.phx.gbl...
What version of ASP.NET are you using?
The answer Sreejith tried to give is incorrect.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Peter" <pc*****@online.nospam> wrote in message news:O6**************@tk2msftngp13.phx.gbl...
When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

Thanks

Peter

Nov 19 '05 #5
One page.
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:OT**************@TK2MSFTNGP15.phx.gbl...
I'm sorry, I see I failed to explain why I thought Sreejith was wrong.
Do you want to go back only one page or back to the homepage of the website?

<%= Clinton Gallagher

"Peter" <pc*****@online.nospam> wrote in message news:uz**************@TK2MSFTNGP14.phx.gbl...
I am using .NET 1.1
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:ug**************@tk2msftngp13.phx.gbl...
What version of ASP.NET are you using?
The answer Sreejith tried to give is incorrect.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Peter" <pc*****@online.nospam> wrote in message news:O6**************@tk2msftngp13.phx.gbl...
When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

Thanks

Peter

Nov 19 '05 #6
Sorry for the interrupting.

Hi Peter,

I think the Request.UrlReferer or javascript window.history.go(-1) all
make sense. However, Request.UrlReferer will contains the original page's
location (it's a standard http header ..), however, this is not always set
by the cilent browser. And as for window.history.go(-1) , this script will
make the clientside browser go back one steps from the browser's history
list(just like when we hit the "back" button on browser...). The problem
of history.go(-1) is that when we have performed some post back on the
form, the postback version of the page will also be added into the history
list , so go(-1) one steps may not meet the requirements. So if there is
postback on the page, we may have to record this , (make a post back count
stored in viewstate...) and so that we can put the count in the history.go(
-count) as parameter...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Peter" <pc*****@online.nospam>
| References: <O6**************@tk2msftngp13.phx.gbl>
<ug**************@tk2msftngp13.phx.gbl>
<uz**************@TK2MSFTNGP14.phx.gbl>
<OT**************@TK2MSFTNGP15.phx.gbl>
| Subject: Re: Go back where I came from
| Date: Sun, 13 Nov 2005 22:43:25 -0600
| Lines: 151
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_000E_01C5E8A3.A8CEDE10"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <OO**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: cpe-69-23-74-9.new.res.rr.com 69.23.74.9
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TFEED02.phx.gbl!tornado.fa
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!newsf eed00.sul.t-online.de!t-on
line.de!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357828
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| One page.
| "clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in
message news:OT**************@TK2MSFTNGP15.phx.gbl...
| I'm sorry, I see I failed to explain why I thought Sreejith was wrong.
| Do you want to go back only one page or back to the homepage of the
website?
| <%= Clinton Gallagher
| "Peter" <pc*****@online.nospam> wrote in message
news:uz**************@TK2MSFTNGP14.phx.gbl...
| I am using .NET 1.1
| "clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in
message news:ug**************@tk2msftngp13.phx.gbl...
| What version of ASP.NET are you using?
| The answer Sreejith tried to give is incorrect.
| <%= Clinton Gallagher
| METROmilwaukee (sm) "A Regional Information Service"
| NET csgallagher AT metromilwaukee.com
| URL http://metromilwaukee.com/
| URL http://clintongallagher.metromilwaukee.com/
| "Peter" <pc*****@online.nospam> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
| When user Clicks on the Close button on the main form I would
like to go back where the user came from. If my form is the first page
since IE was opened I would like to go to the specific website. Is that
possible?
| Thanks
| Peter
|

Nov 19 '05 #7

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

Similar topics

2
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
3
by: icb | last post by:
Hi I have a front-end/back-end setup. The front-end utilises all unbound forms populating the back-end via the code I have written. All fine so far. Prior to splitting the database I ran the...
1
by: Peter D. Dunlap | last post by:
Hello, I realize that this may not be the best place to ask this question, through the application is asp.net. I also realize that questions about disabling the back button are generally met...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
3
by: Tom | last post by:
Basically I have a page that I load with 10 input fields. If users have JS enabled I want to hide 5 of these fields so as to reduce clutter. If the user needs these extra fields an "Add" button can...
22
by: Rickster66 | last post by:
As Instructed this is a new thread regarding my original post: "Select Only 10 Columns Going Back" I'm sorry for the late response. I've been gathering up information and carefully with as much...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.