Merge pull request #12604 from aspnet/tdykstra-patch-1

Mention SkipStatusCodePages attribute
pull/12626/head
Wade Pickett 2019-05-31 13:48:31 -07:00 committed by GitHub
commit 4394b08007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -161,7 +161,9 @@ The endpoint that processes the error can get the original URL that generated th
## Disable status code pages
Status code pages can be disabled for specific requests in a Razor Pages handler method or in an MVC controller. To disable status code pages, use the <xref:Microsoft.AspNetCore.Diagnostics.IStatusCodePagesFeature>:
To disable status code pages for an MVC controller or action method, use the [[SkipStatusCodePages]](xref:Microsoft.AspNetCore.Mvc.SkipStatusCodePagesAttribute) attribute.
To disable status code pages for specific requests in a Razor Pages handler method or in an MVC controller, use <xref:Microsoft.AspNetCore.Diagnostics.IStatusCodePagesFeature>:
```csharp
var statusCodePagesFeature = HttpContext.Features.Get<IStatusCodePagesFeature>();