Click to See Complete Forum and Search --> : newbie: response.redirect or server.transfer won't work...


sirpelidor
05-07-2005, 09:56 PM
Dear developers:

My first programming experience in ASP, so please be patience with me :)

Problem -- making a login page for the site, and i can't redirect user to the member page after login has been done sucessfully.

Server.Transfer "myRegistry.asp?page=accti"

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Transfer'

when trying to do redirect:
response.redirect "myregistry.asp?page=acctin"

Response object error 'ASP 0156 : 80004005'
Header Error
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.

I'm running winxp with IIS 5.1, not sure why Server.Transfer is not functioning, as for response.redirect error, i am not sure what does it mean by "header error", i went through all the include pages, i don't see any of my include asp pages has <head>, <html> or <body>....

please help guide me to the light from this dark tunnel,
thank you very much for your time :)

buntine
05-07-2005, 10:05 PM
As for the Response.Redirect function, you need to turn page buffering on. Put this at the top of the page that uses server-side redirection.

Response.Buffer = True

It simply tells ASP to process the entire page before sending any data to the client.

Regards.

sirpelidor
05-07-2005, 11:41 PM
thanks for ur response buntine, but i got a question here:

going through my entire asp pages, i don't see i modify response.buffer at all, so by default, response.buffer is set to true, isn't?

buntine
05-08-2005, 04:20 AM
Yeah, it is in IIS 5 and 6. If you have upgraded from IIS 4 buffering may still be false by default, though. The error regarding the Transfre method is weird, considering Server.Transfer is definately a valid method in ASP 3.0.

Mayby parentheses are required?

Server.Transfer("myRegistry.asp?page=accti")

Regards.

wmif
05-10-2005, 03:16 PM
for the redirect, is the error on the redirecting page or on the page that it got redirected to?

sirpelidor
05-11-2005, 10:30 AM
Hi wmif

it is a compile error from redirecting page itself. The page got redirect to is ok, because i'm able to type the url and get it there no problem.

thank you

buntine
05-11-2005, 11:16 AM
This article may come in handy: http://www.adopenstatic.com/faq/headererror.asp

Everywhere I look, I am told that this error means that page buffering needs to be enabled. But you say it is already on. Have you double checked this in IIS? (see the above article to see how)

Regards.

sirpelidor
05-14-2005, 03:11 PM
thank you very much buntine, after study that article, i realized the reason i've been dealing with the header issue is because my asp code has been written/arranged in a very poorly manner.

now i just need to take any response.write, or any html related tag away. i can redirect that page to somewhere else.

thank you for your time :)

buntine
05-14-2005, 09:56 PM
No worries. I am glad you got it figured. ;)