I have a page that processes some script. After it does this I want to send the user to a different page. I don't think I can use response.redirect. Does anybody know how to do this.
Printable View
I have a page that processes some script. After it does this I want to send the user to a different page. I don't think I can use response.redirect. Does anybody know how to do this.
Why not open a new page and use a meta tag for redirecting to a page or use javascript client side for redirecting.
Code:<meta http-equiv="refresh" content="1; URL=mypage.asp">\
There should be no reason why you can't do a response.redirect unless you are passing information to another page. In that case you could do a response.redirect with querystrings of the information you are passing in the URL.
i.e.
That will take the information submitted by the form to the script and store it in querystrings to which you can use it in the next page by saying:Code:Dim FirstName, LastName, Email, Password
FirstName = Request.Form("txtFirstName")
LastName = Request.Form("txtLastName")
Email = Request.Form("txtEmail")
Password = Request.Form("txtPassword")
Response.Redirect "page.asp?FirstName=" & FirstName & "&LastName=" & LastName & "&Email=" & Email & "&Password=" & Password
%>
Hope that helps!!!Code:<%
Response.write Request.Querystring("FirstName")
%>
here is my code:
<%
Set objBuilder = Server.CreateObject("BuilderComponent.Start")
objBuilder.Start
Set objBuilder = Nothing
%>
<%
Response.Redirect "Results.asp"
%>
here is my error:
"The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content."
What are you using that object for?
The object is processing a query. I save the results in a text file on my server. I want send the user to a new page that will show the results.
Send me your asp file.
If any header information is printed to the page, you will get this error with REsponse.Redirect. I don't know where this header stuff is being printed (perhaps by your component). Either do not print any html whatsoever (even a blank space) and do the response.redirect:
Or use javascript to redirect:Code:<%
Set objBuilder = Server.CreateObject("BuilderComponent.Start")
objBuilder.Start
Set objBuilder = Nothing
Response.Redirect "Results.asp"
%>
Code:<script langauge="javascript">
window.navigate("Results.asp");
</script>
here it is
Here:I don't believe that requires HTTP headers. If it does, try Server.Transfer "".VB Code:
Server.Execute ""
My server doesn't support this. Maybe it is my version of asp. How can I figure out what version I'm using and how to upgrade?
First U can use response.redirect even after processing....like this:
the response.buffer = true shd be right at the top (only after @language stm).
This will may sure u dont get the error :Code:
<% response.buffer = true %>
<%
'processing whatever
response.redirect "towhateverpage.asp" ' here u can add querystring if u wanr
%>
Quote:
"The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content."
Secondly server.transfer does not work with IIS 4.0 , its added only in IIS 5.0 (Win2K)
Also if u use server.transfer then u cannot pass querystrings.
I hope this solves ur q.
Thanks, I will use response.buffer. The only thing with this is that while I'm buffering my page I can't give the user any feed back. I wanted to show a message telling them to wait, because my script takes several minutes to complete.
though using response.buffer may make it appear that u page is taking a bit long to load - buy actually once it starts loading it comes faster.
also uu can show a layer from the calling page till ur next page is dispayed. though it may not be very helpful - but still