You're building a simple website using ASP.NET Core. You want to display a friendly error page when something goes wrong in your application. What's the standard way to do this in ASP.NET Core?
- Custom Error Page
- Detailed Logging
- Exception Handling Middleware
- Using Console.WriteLine()
The standard way to display a friendly error page in ASP.NET Core is by using Exception Handling Middleware. This middleware captures unhandled exceptions and can be configured to display custom error pages, making it easier for users to understand what went wrong.
Loading...
Related Quiz
- Imagine you have two route templates: /products/{id} and /products/new. An incoming request has the URL /products/new. Which route will it match and why?
- The @ViewData object is a type of _________, allowing you to pass data from the controller to the view.
- If you want to specify multiple roles for an action or a controller using the [Authorize] attribute, how would you do it?
- How can you protect a controller action to be accessible only by users with the role "Admin" using the [Authorize] attribute?
- How can you configure Entity Framework Core to use lazy loading for navigation properties?