Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Redirect


Message #1 by "casmur" <casmur@h...> on Tue, 27 Mar 2001 18:33:08
Can someone tell me if there is away to use a target frame on a 

response.redirect 



Thanks!



cc

Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 28 Mar 2001 13:39:36 +0100
response.redirect is a server function, it can only reply to the request,

and therefore only send data to the window or frame that the request came

from.



When you specify a target in a hyperlink, all that that means is that the

browser sends the request from the specified frame.



-----Original Message-----

From: casmur [mailto:casmur@h...]

Sent: Tuesday, March 27, 2001 7:33 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Redirect





Can someone tell me if there is away to use a target frame on a 

response.redirect 



Thanks!



cc

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #3 by "Ken Schaefer" <ken@a...> on Wed, 28 Mar 2001 23:05:30 +1000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

: Can someone tell me if there is away to use a target frame on a

: response.redirect

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



No



Response.Redirect() issues a HTTP 302 Object Has Temporarily Moved header to

the client when the client requests a resource (eg a webpage). The client

then issues a new request for the resource in the new location. Since frames

are entirely a client side thing, there is no way for the server to specify

that the page be loaded in a different frame.



Instead, write some client-side javascript that causes the request to be

issued by the alternate frame.



Cheers

Ken



Message #4 by Scott Watermasysk <swatermasysk@C...> on Wed, 28 Mar 2001 14:12:29 -0500
However, there are two work arounds:



A work around for this could be to put <base target="_top"> in the head of

your frame page. This will set a default frame. Thus any Response.Redirect

from with in that frameset will goto to the "_top" (or what ever other page

you want), but this also means every redirect will go to the same frame. If

this is what you want then this will work. If not, see below.



You could also write a form with no details to your document and then auto

submit it.



If x = 1 Then 'What ever your condition is



	Response.Write "<Form Name = 'Form1' Action ='gotothispage.asp'

Target = '_Top'> </Form><script 

	

language='JavaScript'>setTimeout('document.Form1.submit();', 0);</script>"

	Response.Flush

	Response.End

End If

	

I have no idea what this will do to your performance. I would imagine it

would be minimal, but I don't know for sure. This also means your end user

must of javascript enabled.



Let me know if this helps.



-Scott



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, March 28, 2001 7:40 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Redirect





response.redirect is a server function, it can only reply to the request,

and therefore only send data to the window or frame that the request came

from.



When you specify a target in a hyperlink, all that that means is that the

browser sends the request from the specified frame.



-----Original Message-----

From: casmur [mailto:casmur@h...]

Sent: Tuesday, March 27, 2001 7:33 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Redirect





Can someone tell me if there is away to use a target frame on a 

response.redirect 



Thanks!



cc

  Return to Index