Hi,
in startup.cs i use this code to manage errors (404 , 500 , ...)
and its worked correctly when i search a action thats not found and go to error action .
I refer to this
artical, and when I return NotFound(), it will display the custom error page with 404.
If it is not helpful to you, you can share us your error function.
Best Regards,
Jiadong Meng
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
39 Points
197 Posts
Return Not Found From Controller
Jun 14, 2020 08:37 AM|elahi1mahdi|LINK
Hi,
in startup.cs i use this code to manage errors (404 , 500 , ...)
and its worked correctly when i search a action thats not found and go to error action .
but in controller when a id is not exsist i use this code
but its not work i want when i use NotFound its return to error action
Participant
1320 Points
491 Posts
Re: Return Not Found From Controller
Jun 15, 2020 09:37 AM|jiadongm|LINK
Hi elahi1mahdi,
I refer to this artical, and when I return NotFound(), it will display the custom error page with 404.
If it is not helpful to you, you can share us your error function.
Best Regards,
Jiadong Meng