HttpResponseWrapper.RedirectToRoute HttpResponseWrapper.RedirectToRoute HttpResponseWrapper.RedirectToRoute HttpResponseWrapper.RedirectToRoute Method

Definition

Redirects a request to a new URL by using the specified route parameter values, a route name, or both.

Overloads

RedirectToRoute(Object) RedirectToRoute(Object) RedirectToRoute(Object) RedirectToRoute(Object)

Redirects a request to a new URL by using the specified route parameter values.

RedirectToRoute(String) RedirectToRoute(String) RedirectToRoute(String) RedirectToRoute(String)

Redirects a request to a new URL by using the specified route name.

RedirectToRoute(RouteValueDictionary) RedirectToRoute(RouteValueDictionary) RedirectToRoute(RouteValueDictionary) RedirectToRoute(RouteValueDictionary)

Redirects a request to a new URL by using the specified route parameter values.

RedirectToRoute(String, Object) RedirectToRoute(String, Object) RedirectToRoute(String, Object) RedirectToRoute(String, Object)

Redirects a request to a new URL by using the specified route name and route parameter values.

RedirectToRoute(String, RouteValueDictionary) RedirectToRoute(String, RouteValueDictionary) RedirectToRoute(String, RouteValueDictionary) RedirectToRoute(String, RouteValueDictionary)

Redirects a request to a new URL by using the specified route name and route parameter values.

RedirectToRoute(Object) RedirectToRoute(Object) RedirectToRoute(Object) RedirectToRoute(Object)

Redirects a request to a new URL by using the specified route parameter values.

public:
 override void RedirectToRoute(System::Object ^ routeValues);
public override void RedirectToRoute (object routeValues);
override this.RedirectToRoute : obj -> unit
Public Overrides Sub RedirectToRoute (routeValues As Object)
Parameters
routeValues
Object Object Object Object

The route parameter values.

Exceptions

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the Redirect(String, Boolean) method with the second parameter set to false.

This method converts the object that is passed in routeValues to a System.Web.Routing.RouteValueDictionary object by using the RouteValueDictionary.RouteValueDictionary(Object) constructor. The RouteCollection.GetVirtualPath method is then called to determine the URL.

ASP.NET performs the redirection by returning a 302 HTTP status code.

RedirectToRoute(String) RedirectToRoute(String) RedirectToRoute(String) RedirectToRoute(String)

Redirects a request to a new URL by using the specified route name.

public:
 override void RedirectToRoute(System::String ^ routeName);
public override void RedirectToRoute (string routeName);
override this.RedirectToRoute : string -> unit
Public Overrides Sub RedirectToRoute (routeName As String)
Parameters
routeName
String String String String

The name of the route.

Exceptions

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the Redirect(String, Boolean) method with the second parameter set to false.

This method converts the route name that is passed in routeName to a URL by using the RouteCollection.GetVirtualPath method.

ASP.NET performs the redirection by returning a 302 HTTP status code.

RedirectToRoute(RouteValueDictionary) RedirectToRoute(RouteValueDictionary) RedirectToRoute(RouteValueDictionary) RedirectToRoute(RouteValueDictionary)

Redirects a request to a new URL by using the specified route parameter values.

public:
 override void RedirectToRoute(System::Web::Routing::RouteValueDictionary ^ routeValues);
public override void RedirectToRoute (System.Web.Routing.RouteValueDictionary routeValues);
override this.RedirectToRoute : System.Web.Routing.RouteValueDictionary -> unit
Public Overrides Sub RedirectToRoute (routeValues As RouteValueDictionary)
Parameters
Exceptions

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the Redirect(String, Boolean) method with the second parameter set to false.

This method calls the RouteCollection.GetVirtualPath method to determine the URL.

ASP.NET performs the redirection by returning a 302 HTTP status code.

RedirectToRoute(String, Object) RedirectToRoute(String, Object) RedirectToRoute(String, Object) RedirectToRoute(String, Object)

Redirects a request to a new URL by using the specified route name and route parameter values.

public:
 override void RedirectToRoute(System::String ^ routeName, System::Object ^ routeValues);
public override void RedirectToRoute (string routeName, object routeValues);
override this.RedirectToRoute : string * obj -> unit
Public Overrides Sub RedirectToRoute (routeName As String, routeValues As Object)
Parameters
routeName
String String String String

The name of the route.

routeValues
Object Object Object Object

The route parameter values.

Exceptions

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the Redirect(String, Boolean) method with the second parameter set to false.

This method converts the object that is passed in routeValues to a System.Web.Routing.RouteValueDictionary object by using the RouteValueDictionary.RouteValueDictionary(Object) constructor. The RouteCollection.GetVirtualPath method is then called to determine the URL.

ASP.NET performs the redirection by returning a 302 HTTP status code.

RedirectToRoute(String, RouteValueDictionary) RedirectToRoute(String, RouteValueDictionary) RedirectToRoute(String, RouteValueDictionary) RedirectToRoute(String, RouteValueDictionary)

Redirects a request to a new URL by using the specified route name and route parameter values.

public:
 override void RedirectToRoute(System::String ^ routeName, System::Web::Routing::RouteValueDictionary ^ routeValues);
public override void RedirectToRoute (string routeName, System.Web.Routing.RouteValueDictionary routeValues);
override this.RedirectToRoute : string * System.Web.Routing.RouteValueDictionary -> unit
Public Overrides Sub RedirectToRoute (routeName As String, routeValues As RouteValueDictionary)
Parameters
routeName
String String String String

The name of the route.

Exceptions

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the Redirect(String, Boolean) method with the second parameter set to false.

The RouteCollection.GetVirtualPath method is called to determine the URL.

ASP.NET performs the redirection by returning a 302 HTTP status code.

Applies to