HttpResponse.Redirect Method Home
This page is specific to:.NET Framework Version:1.12.03.03.54.0
.NET Framework Class Library
HttpResponse.Redirect Method

Redirects a client to a new URL.

Overload List

Redirects a client to a new URL and specifies the new URL.

[Visual Basic] Overloads Public Sub Redirect(String)
[C#] public void Redirect(string);
[C++] public: void Redirect(String*);
[JScript] public function Redirect(String);

Redirects a client to a new URL. Specifies the new URL and whether execution of the current page should terminate.

[Visual Basic] Overloads Public Sub Redirect(String, Boolean)
[C#] public void Redirect(string, bool);
[C++] public: void Redirect(String*, bool);
[JScript] public function Redirect(String, Boolean);

Example

The following example forces an unconditional redirection to another Web site.

[Visual Basic] 
Response.Redirect("http://www.microsoft.com/gohere/look.htm")
   

[C#] 
Response.Redirect("http://www.microsoft.com/gohere/look.htm");
   

[C++] 
Response->Redirect(S"http://www.microsoft.com/gohere/look.htm");
   

[JScript] 
Response.Redirect("http://www.microsoft.com/gohere/look.htm")
   

See Also

HttpResponse Class | HttpResponse Members | System.Web Namespace

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View