473,399 Members | 3,656 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,399 software developers and data experts.

Catch previous url

Hi,

I have a question on how to get the previous url in custom error file. Here
is what I am doing:

If someone visit my website with a wrong file name or wrong directory name,
IIS will automatically show error 404 page, this was setup by default in IIS
web site properties/Custom Errors. I replaced that 404b.htm with my aspx
file try to handle this error by myself. the problem is that I can not get
previous url that user requested in my aspx page, I was thinking that
urlreferer property, but it does not work either. Does anybody has
experience on this issue before?

If I don't use that custom error page, do I have anyway to get control even
the file or directory specified in the request does not exist on my website?

Any suggestion will be appreciated.

Jason
Nov 18 '05 #1
2 1754
I think you may try using javascript like this:
<input type="button" name="return" value="Prev" onClick="window.history.go(-1);">

"Jason Zhou" wrote:
Hi,

I have a question on how to get the previous url in custom error file. Here
is what I am doing:

If someone visit my website with a wrong file name or wrong directory name,
IIS will automatically show error 404 page, this was setup by default in IIS
web site properties/Custom Errors. I replaced that 404b.htm with my aspx
file try to handle this error by myself. the problem is that I can not get
previous url that user requested in my aspx page, I was thinking that
urlreferer property, but it does not work either. Does anybody has
experience on this issue before?

If I don't use that custom error page, do I have anyway to get control even
the file or directory specified in the request does not exist on my website?

Any suggestion will be appreciated.

Jason

Nov 18 '05 #2
Good point, but the problem is that I want to get the url instead of go
that url, according to internet sdk, this previous url is not exposed
for surity reason, so I still can not make it.

But thanks anyway!

Jason


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

10
by: Gary.Hu | last post by:
I was trying to catch the Arithmetic exception, unsuccessfully. try{ int a = 0, b = 9; b = b / a; }catch(...){ cout << "arithmetic exception was catched!" << endl; } After ran the program,...
37
by: clintonG | last post by:
Has somebody written any guidelines regarding how to determine when try-catch blocks should be used and where their use would or could be considered superfluous? <%= Clinton Gallagher...
13
by: Benny | last post by:
Hi, I have something like this: try { // some code } catch // note - i am catching everything now {
23
by: VB Programmer | last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally. Example: In order to close/dispose a db connection you have to dim the connection outside of the Try Catch Finally...
1
by: Jason Zhou | last post by:
Hi, I have a question on how to get the previous url in custom error file. Here is what I am doing: If someone visit my website with a wrong file name or wrong directory name, IIS will...
9
by: Michael MacDonald | last post by:
Does someone have a good site I can visit or explain the use of Try" and Catch foe exception/error handling. What is the logic behind this command and maybe an example would be great!!!! Mike_Mac...
32
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I...
3
by: Michael C | last post by:
I'm writing an app on the PDA using C# with .net 1.1. It is all working well except in some cases a try catch is simply ignored and a totally different error is returned. I've got code like below...
7
by: junw2000 | last post by:
class A { public: A() { try { p = new int; //Other lines that may throw exception. }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.