Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirection

Status
Not open for further replies.

scohan

Programmer
Dec 29, 2000
283
US
Using NT 4 and IIS, I've created a second virtual directory and copied pages from one to the other. Why when I hit the redirection statement do I get the following error using the second virtual directory, but I don't get this when using the original virtual directory? Thanks.

Response object error 'ASP 0156 : 80004005'

Header Error

/stgwebtop/asp/login.asp, line 37

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
 
you can't redirect if you'vce already written any text to the page. adam@aauser.com
 
You can also specify page buffering by using
<%@ Response.Buffer = true %> at the top of your page. Then you can call response.redirect() any time in the page.

Also, if you are using IIS 5.0 (usually shipped with Windows 200) you can just call Server.Transfer() to tell the server to move to a new page. This does not send a redirection header to the browser. It only works with ASP 3.0 with IIS 5.0. If you don't know what version of IIS you are using, I recommend not using ASP 3.0 methods. Most computers are using IIS 2.0 right now.

Harold Blackorby
hblackorby@scoreinteractive.com
 
I can solve it by using <% Response.Butffer = True %>, but I'm curious why I have to use this for the second virtual directory, but not for the original virtual directory. There's no <% Response.Buffer = True %> in the original code and it works fine.
 
My guess would be that the response.redirect statement in the original code probably comes before any text (or headers) have been written to the page.
 
Thanks, but it's the exact same file just called from a different directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top