473,225 Members | 1,264 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,225 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 12192
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)....
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.