The HttpResponse class implements two overloaded versions of the Redirect method.
The first overloaded method takes only one input parameter, which is the URL for the target location. This version is defined as follows:
Overloads Public Sub Redirect(ByVal url As String)
The second overloaded method takes two input parameters: the URL for the target location, and a boolean value that indicates whether to stop running the current page. This version is defined as follows:
Overloads Public Sub Redirect(ByVal url As String, _ ByVal endResponse As Boolean)
When you use the first overloaded version, the second overloaded version is called internally and is passed a boolean value of True for the second input parameter. For more information about the HttpResponse class and its related methods, refer to the REFERENCES section.
If you try to redirect after the headers are sent to the browser, you receive an HttpException exception. To resolve this problem, use the HttpResponse.BufferOutput property to buffer the output when appropriate. This property is set to True by default.
For more information about the HttpResponse.BufferOutput property, refer to the REFERENCES section.
You may receive a ThreadAbortException exception when you use this method.For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
312629 PRB: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer