Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 11th, 2003, 11:30 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Response.Redirect

If I use the Response.Redirect on the previous page (24ProcAddEdit.asp), the following code will not work as intended.
The third choice (Else) will happen promting the question "where did you come from".
It appears that -Request.ServerVariables("HTTP_REFERER")- does not see what the previous page was. How do I fix this?
If I remove the Response.Redirect from the previous page and use a link to manualy get to this page it works fine

'Begin HOW DID WE GET HERE
If InStr(Request.ServerVariables("HTTP_REFERER"), "24ProcAddEdit.asp") Then
     strQSMEID = Session("sv24MEID")
     Response.Write "You came from 24"
 ElseIf InStr(Request.ServerVariables("HTTP_REFERER"), "20AddNewME.asp") Then
      strQSMEID =Request.QueryString ("MEID")
      Response.Write "You came from 20"
Else
            Response.Write "Where did you come from?"
End If
'End HOW DID WE GET HERE
Reply With Quote
  #2 (permalink)  
Old June 11th, 2003, 12:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Response.Redirect just reroute your browser request. In other words you don't receive 200 response code from the page contains only Response.Redirect statement.
So, ServerVariables("HTTP_REFERER") will contains the address (if exists) from which you arrived to 24ProcAddEdit.asp.

HTH.

...but the Soon is eclipsed by the Moon
Reply With Quote
  #3 (permalink)  
Old June 11th, 2003, 01:05 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there an alternative to Response.Redirect?

Thanks
Reply With Quote
  #4 (permalink)  
Old June 11th, 2003, 01:12 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Yes, there is. On the server you can use Server.Transfer, which skips the step of informing the client browser.

You can also use Response.Write to push some JavaScript to the client, using location.href to force the browser to request a new page (you can pass in the old URL so in the user's experience he "goes back" while in reality (history-wise) he'' go forward).


Cheers,

Imar
Reply With Quote
  #5 (permalink)  
Old June 16th, 2003, 05:56 AM
Registered User
 
Join Date: Jun 2003
Location: Marikina City, Metro Manila, Philippines.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also used javascript to jump to other pages. It's much more easier. Try it.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.Redirect in c# class. manish.sharma04 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 17 February 28th, 2012 07:01 PM
response.redirect sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 27th, 2006 08:57 AM
response.redirect ava_h .NET Framework 2.0 0 October 18th, 2006 10:21 PM
response.redirect crmpicco Classic ASP Basics 3 February 9th, 2005 01:50 AM
Using response.redirect wi shs BOOK: Beginning ASP.NET 1.0 3 April 2nd, 2004 09:54 AM



All times are GMT -4. The time now is 02:37 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.