User-1330468790 posted
Hi, ellawei33,
Your code should be working for your purpose as it seems no error inside the code.
I suggest you debug the code to find out more details about that
500 Internal Server Error.
Solution:
You can run your app in debug mode and check the property
AllErrors.
Open the Global.asax.cs and in the body of the class add method:
protected void Application_EndRequest()
{ // Add the breakpoint here
// Right click and select quick watch and you will find the exceptions at code: this.Context.AllErrors
// Or you can add the code here and directly check the value of AllErrors
}
Moreover, if you could not find the error details from the browser, debug mode would be always helpful to find them since they tells what the exact problem is.
Hope this can help you.
Best regards,
Sean