mention SkipStatusCodePages attribute
parent
7eecedc61d
commit
b8e50f1117
|
@ -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>();
|
||||
|
|
Loading…
Reference in New Issue