I am working in ASP.NET MVC. I am using partial views, but when I clicked on particular link I got the following error.
500 Internal Server Error
How can this error be fixed?
Clear your browser cache and cookies Check these articles on deleting the cache on an Android phone or iPhone, if you use a mobile device. Alternatively, you can test opening the page from another browser. For instance, if you use Chrome, try Firefox or vice versa.
500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. To resolve this issue, set the Enable 32-bit Applications to "False": Open the Internet Information Services (IIS) Manager.
The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.
To check what causes Internal Server 500 Error under ASP MVC you can also run your app in debug mode and check property AllErrors.
The property is an array of Exception type elements.
To do this open Global.asax.cs
(C#) and in the body of class MvcApplication
put method Application_EndRequest
:
protected void Application_EndRequest() { //here breakpoint // under debug mode you can find the exceptions at code: this.Context.AllErrors }
Then set breakpoint and check contents of the array: this.Context.AllErrors
It helped me to resolve what exception was thrown and optionally to see the stacktrace.
500 Server error means that a script has thrown an error, this is not a broken link (aka a 404 error).
If you are using Internet Explorer, go to tools > options > advanced
and unselect friendly http errors
, this will give you a more comprehensive description of the error so you can debug the script, or contact the relevant people to debug it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With