PageModel.RedirectToPage Method

Definition

Overloads

RedirectToPage()

Redirects (Status302Found) to the current page.

RedirectToPage(Object)

Redirects (Status302Found) to the current page with the specified routeValues.

RedirectToPage(String)

Redirects (Status302Found) to the specified pageName.

RedirectToPage(String, Object)

Redirects (Status302Found) to the specified pageName using the specified routeValues.

RedirectToPage(String, String)

Redirects (Status302Found) to the specified pageName using the specified pageHandler.

RedirectToPage(String, String, Object)

Redirects (Status302Found) to the specified pageName using the specified pageHandler and routeValues.

RedirectToPage(String, String, String)

Redirects (Status302Found) to the specified pageName using the specified fragment.

RedirectToPage(String, String, Object, String)

Redirects (Status302Found) to the specified pageName using the specified routeValues and fragment.

RedirectToPage()

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the current page.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage ();

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(Object)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the current page with the specified routeValues.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (object routeValues);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (object? routeValues);

Parameters

routeValues
Object

The parameters for a route.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the specified pageName.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string pageName);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string? pageName);

Parameters

pageName
String

The name of the page.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(String, Object)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the specified pageName using the specified routeValues.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string pageName, object routeValues);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string? pageName, object? routeValues);

Parameters

pageName
String

The name of the page.

routeValues
Object

The parameters for a route.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(String, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the specified pageName using the specified pageHandler.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string pageName, string pageHandler);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string? pageName, string? pageHandler);

Parameters

pageName
String

The name of the page.

pageHandler
String

The page handler to redirect to.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(String, String, Object)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the specified pageName using the specified pageHandler and routeValues.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string pageName, string pageHandler, object routeValues);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string? pageName, string? pageHandler, object? routeValues);

Parameters

pageName
String

The name of the page.

pageHandler
String

The page handler to redirect to.

routeValues
Object

The parameters for a route.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(String, String, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the specified pageName using the specified fragment.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string pageName, string pageHandler, string fragment);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string? pageName, string? pageHandler, string? fragment);

Parameters

pageName
String

The name of the page.

pageHandler
String

The page handler to redirect to.

fragment
String

The fragment to add to the URL.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

RedirectToPage(String, String, Object, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Redirects (Status302Found) to the specified pageName using the specified routeValues and fragment.

C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string pageName, string pageHandler, object routeValues, string fragment);
C#
public virtual Microsoft.AspNetCore.Mvc.RedirectToPageResult RedirectToPage (string? pageName, string? pageHandler, object? routeValues, string? fragment);

Parameters

pageName
String

The name of the page.

pageHandler
String

The page handler to redirect to.

routeValues
Object

The parameters for a route.

fragment
String

The fragment to add to the URL.

Returns

The RedirectToPageResult.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0