|
-
Nov 3rd, 2000, 02:48 PM
#1
okay. i have this code and it's giving me this error, and the line that's causing this error is where i type
Code:
response.redirect "redir.asp"
the error message is:
Response object error 'ASP 0156 : 80004005'
Header Error
/redirect.asp, line 12
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page
content.
and this is the source code:
Code:
<%@ Language=VBScript%>
<!--#include file="ADOvbs.inc"-->
<html>
<head>
<title>trying redirect</title>
</head>
<body>
<%
Dim varConfirm
varConfirm = Request.Form("rConfirm") 'no problem here
If varConfirm="no" Then
Response.redirect "redir.asp"
else
' code if varConfirm="yes"
end if
%>
</body>
</html>
-
Nov 3rd, 2000, 03:29 PM
#2
Frenzied Member
You can't use response.redirect after the <HTML> tag has been written to the browser.
If you put it before the HTML tag, it will work fine.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Nov 3rd, 2000, 03:39 PM
#3
thanks, dude
i knew it had to be something simple. sorry. just self-studying with asp, see. and the book i'm using as reference put response.redirect in between the <html> tags.
-
Nov 4th, 2000, 07:07 PM
#4
Actually it has to do with when the http header is sent back to the requesting client(like the error message stated) and not with the "<html>" tag. The following works perfectly because the Response.Buffer = True statement...
Code:
<%
Option Explicit
Response.Buffer = True
%>
<html>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
test
</body>
</html>
<%
Response.Redirect "http://msdn.microsoft.com/"
%>
-
Nov 5th, 2000, 12:29 AM
#5
Frenzied Member
That's true.. In his case I simply assumed he had not set the html stream to buffer so it was outputting as it was going along..
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|