Forum Discussion

Malam115's avatar
Malam115
Copper Contributor
Dec 09, 2023

How to handle Exceptions in VBHTML Razor page?

I have several razor page website in .vbhtml and none have any error handling in it causing errors to generate server/application exceptions.

 

How do I add exception handling to these pages to display meaningful messages to users?

And, how do I log the detailed exception to a log file or a SQL table?

1 Reply

  • HI Malam115 ,
    Yes, you can add exceptions to the VBHTML Razor page.
    Here are your problem solutions.

    https://stackoverflow.com/questions/76996606/how-to-catch-exception-thrown-in-asp-net-core-razor-page-middleware

    Thanks & BestRegards,

    AddWebsolution

Resources