Library code snippets
Redirecting Without Halting Execution
By Lee Gunn - .NET C# Scotland, published on 21 Jul 2005
This snippet demonstrates how to send a redirect to a client without halting execution. This can be useful if you want the client to be immediately request a fresh page leaving your ASP script to continue processing a time consuming task.
Response.Buffer = True
' Set the HTTP Status to 302 (Moved)
Response.Status = "302 Moved Temporarily"
' Add a Location HTTP Header
Response.addheader "Location", "http://www.the-redirect-url.com"
' Add a Content-Length header equal to zero so that client assumes
' there is nothing coming after the http headers
Response.addheader "Content-Length", "0"
' Flush the buffered response
Response.Flush
' Do time consuming stuff here...
Related articles
Related discussion
-
Read eMails from Outlook express using ASP
by kumaravelu (1 replies)
-
Help to Call ASP function from onclick event in HTML to pass an array
by vka (0 replies)
-
Binary Studio | software development outsourcing Ukraine
by shane124 (4 replies)
-
Variable In Vb.Net
by chia (0 replies)
-
ideas in building a captive portal
by sjranjan (2 replies)
Related podcasts
-
Scott Guthrie
Scott catches up with Scott Guthrie in an interview covering Ajax, Asp 2.0, extender controls, CSS adapters and more.
This thread is for discussions of Redirecting Without Halting Execution.