ViewComponent exception handling

Michael P 20 Reputation points
2025-12-13T18:28:55.8233333+00:00

Hi,

What is the correct way to handle exceptions in a view component? I would like the user to end up being redirected to an error page.

So do I catch exceptions in the view component and redirect from there, or is it possible to do it in the view that is using the view component and if so how?

Thanks in advance!

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.