Response.TrySkipIisCustomErrors equivalent command in asp.net core?

1

Is there a way to return an error in net asp only for a particular action without using the custom errors page? I used Response.TrySkipIisCustomErrors=true; but in ASP.Net Core it does not exist anymore.

    
asked by anonymous 14.03.2018 / 04:47

1 answer

1

There is. A simple way to display the user's error message is by using the TempData collection, whose function is to store temporary data that can be used in subsequent requests. (Note you can download the project on GitHub through the link link )

Let's see how it goes in practice:

1- Create an ASP.NET Core Web Application. Select File > New > Project. 2-CreateaClientClass

3-CreateaViewComponentPnotifyMessages

4-AddViewComponentintheLayout.cshtmlfile.

5-CreateanActionCreateClient.

    
19.03.2018 / 21:59