|
-
Feb 7th, 2001, 12:05 PM
#1
Thread Starter
Hyperactive Member
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
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Feb 7th, 2001, 01:26 PM
#2
Black Cat
Response.Redirect must be called before any Response.Write's.
Josh
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Feb 7th, 2001, 01:30 PM
#3
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.
-
Feb 8th, 2001, 05:20 AM
#4
Thread Starter
Hyperactive Member
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
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Feb 8th, 2001, 03:13 PM
#5
Hyperactive Member
put Response.Clear right before the response.redirect. that should do the trick mate.
-
Feb 9th, 2001, 06:14 AM
#6
Thread Starter
Hyperactive Member
Got this message
Response object error 'ASP 0159 : 80004005'
Buffering Off
/comp/default.asp, line 256
Buffering must be on.
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Feb 9th, 2001, 07:27 AM
#7
Thread Starter
Hyperactive Member
Put at the start this
response.buffer = true
seems to whirl away and do nowt..
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
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
|