Alternative to Response.Redirect

C

Colin Steadman

I'm looping through an array of employee numbers and
sending them to an Oracle procedure for processing. While
I'm doing this I'm updating a <DIV> tag in the browser
with index number of the current array item so the user
knows how far along in processing we are. The ASP looks
something like this:

<div id=messageToUserTxT>Please wait...</div>

<%
For i = LBound(arrayOfEmployeeNumbers) To _
UBound(arrayOfEmployeeNumbers)

'...Generate and execute SQL
cn.execute SQL

%>
<script language=javascript>
document.getElementById('messageToUserTxT').innerText
= 'Processing said:
</script>
<%
Response.flush()
Next
%>

This does exactly what I want it to do, but I now get this
error when I try and redirect the user to another page
when the processing is complete:


The HTTP headers are already written to the client
browser. Any HTTP header modifications must be made
before writing page content


According to some posts I've seen in the forum this
happens because I've already written some HTML to the
browser.

I was wondering therefore if there is any way I could
redirect the user to the next page using some other
mechanism? I seem to recall an alternative to using
Response.Redirect, but I cant remember what it is!

Any ideas?

Thanks,

Colin
 
R

Ray Costanzo [MVP]

You'd have to use a client-side "alternative" such as:

location.href='someotherpage.asp';

Ray at work
 
C

Colin Steadman

-----Original Message-----
You'd have to use a client-side "alternative" such as:

location.href='someotherpage.asp';

Ray at work


OK, thankyou Ray.

Colin
 
E

Evertjan.

Ray Costanzo [MVP] wrote on 16 nov 2004 in
microsoft.public.inetserver.asp.general:
You'd have to use a client-side "alternative" such as:

location.href='someotherpage.asp';

Strange as it seems

Response.redirect 'someotherpage.asp'

is in fact a clientside action.
Only a browser understanding the header directive,
will execute that code and redirect.
However

Server.transfer 'someotherpage.asp'

is strictly serverside.
 
G

Guest

Server.transfer 'someotherpage.asp'

is strictly serverside.


Aha! Thats what I was looking for.

However I've since incorporated 'someotherpage.asp' into
the processing one, and it seems to work rather well.

But thanks anyway.

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top