Muokkaa

Jaa


HttpResponseWrapper.RedirectToRoutePermanent Method

Definition

Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values, a route name, or both.

Overloads

RedirectToRoutePermanent(String, Object)

Performs a permanent redirection from a requested URL to a new URL by using a route name and route parameter values that correspond to the new URL.

RedirectToRoutePermanent(Object)

Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values.

RedirectToRoutePermanent(String)

Performs a permanent redirection from a requested URL to a new URL by using the specified route name.

RedirectToRoutePermanent(RouteValueDictionary)

Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values.

RedirectToRoutePermanent(String, RouteValueDictionary)

Performs a permanent redirection from a requested URL to a new URL by using the specified route name and route parameter values.

RedirectToRoutePermanent(String, Object)

Performs a permanent redirection from a requested URL to a new URL by using a route name and route parameter values that correspond to the new URL.

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

Parameters

routeName
String

The name of the route.

routeValues
Object

The route parameter values.

Exceptions

No route corresponds to the specified route parameters.

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the RedirectPermanent 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 301 HTTP status code.

See also

Applies to

RedirectToRoutePermanent(Object)

Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values.

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

Parameters

routeValues
Object

The route parameter values.

Exceptions

No route corresponds to the specified route parameters.

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the RedirectPermanent(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 301 HTTP status code.

See also

Applies to

RedirectToRoutePermanent(String)

Performs a permanent redirection from a requested URL to a new URL by using the specified route name.

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

Parameters

routeName
String

The name of the route.

Exceptions

No route corresponds to the specified route name.

Redirection was attempted after the HTTP headers had been sent.

Remarks

This method is provided for coding convenience. It is equivalent to calling the RedirectPermanent(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 301 HTTP status code.

See also

Applies to

RedirectToRoutePermanent(RouteValueDictionary)

Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values.

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

Parameters

routeValues
RouteValueDictionary

The route parameter values.

Exceptions

No route corresponds to the specified route parameters.

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 301 HTTP status code.

See also

Applies to

RedirectToRoutePermanent(String, RouteValueDictionary)

Performs a permanent redirection from a requested URL to a new URL by using the specified route name and route parameter values.

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

Parameters

routeName
String

The name of the route.

routeValues
RouteValueDictionary

The route parameter values.

Exceptions

No route corresponds to the specified route parameters.

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 301 HTTP status code.

See also

Applies to