-
This is doing my head in....
how do i redirect after updating a database to see latest entries
code: extract
FOR i = 1 to RSAddrecord.Fields.Count -1
'RS.Fields(i).Value = RS.Fields(i).Name
if(RSAddrecord.Fields(i).Name <>"ID" ) then
RSAddrecord.Fields(i).Value = Request.Form(RSAddrecord.Fields(i).Name)
end if
if(RSAddrecord.fields(i).Name = "date") then
RSAddrecord.Fields(i).Value = Now()
end if
NEXT
RSAddrecord.Update
end if
RSAddrecord.Close
GobjConnect.Close
Update = 1
session("update") = Update
End Sub
Response.Write "</table>"
Response.Write "<a href=default.asp?mode=1>Login</a>"
Response.Write "</body>"
Response.Write "</html>"
If session("update") = 1 then
Response.Redirect("default.asp") /// i get waring that headers are already written
end if
%>
Many thanks
-
Response.Redirect must be called before any Response.Write's.
Josh
-
Do you know Any Javascript. If you do you can put a hidden text box in the page. When the page first loads have it set to 0 and when you have updated change it to 1.
Put a JavaScript event on the hidden field and when it's changed run this script:
{
document.location = "www.mypage.com"
}
that's probably not much use, I took pity on you not having any replies. :D
-
The Repsonse.redirect is called before the repsonse.write's, this is the last event of the page...
Any help Ian?? seems your the man
-
put Response.Clear right before the response.redirect. that should do the trick mate.
-
Got this message
Response object error 'ASP 0159 : 80004005'
Buffering Off
/comp/default.asp, line 256
Buffering must be on.
-
Put at the start this
response.buffer = true
seems to whirl away and do nowt..