473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Alternative to Response.Redirect

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').innerT ext
= 'Processing <%=i%> of <%=UBound(arrayOfEmployeeNumbers)%
';

</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
Jul 22 '05 #1
5 12353
You'd have to use a client-side "alternative" such as:

location.href='someotherpage.asp';

Ray at work
"Colin Steadman" <an*******@discussions.microsoft.com> wrote in message
news:70****************************@phx.gbl...

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!

Jul 22 '05 #2
Ray Costanzo [MVP] wrote on 16 nov 2004 in
microsoft.public.inetserver.asp.general:
"Colin Steadman" <an*******@discussions.microsoft.com> wrote in message
news:70****************************@phx.gbl...

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!


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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 22 '05 #3
>-----Original Message-----
You'd have to use a client-side "alternative" such as:

location.href='someotherpage.asp';

Ray at work

OK, thankyou Ray.

Colin
Jul 22 '05 #4
>
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
Jul 22 '05 #5
http://www.aspfaq.com/2011
http://www.aspfaq.com/2217

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Colin Steadman" <an*******@discussions.microsoft.com> wrote in message
news:70****************************@phx.gbl...
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').innerT ext
= 'Processing <%=i%> of <%=UBound(arrayOfEmployeeNumbers)%
';

</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

Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
4
by: JC | last post by:
Hi, I have a simple question regarding the Response.Redirect method. Does the server stop processing the ASP code as soon as it encounters the Redirect command? Or does it ever continue to...
4
by: TomT | last post by:
Hi.. I'm redirecting users to another page using: response.redirect("newpage.asp") this works... But I need to add a variable to the page specified.. IE: newpage.asp?id=JobID
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
2
by: Ben Fidge | last post by:
Is FormsAuthentication.RedirectFromLoginPage the only way to populate the HttpContext.Current.User.Identity.Name property? A base class for each page contains the follwoing property: public...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.