We have developed a website that uses MVC, C#, and jQuery. In one of my controller classes we are validating inputs from the user and if it fails we throw an exception that the Ajax error parameter(aka option) handles. (We use Block UI to display the error message. BlockUI is a jQuery plugIn that blocks the screen and displays a message box.)
(Yes, the message has text in it with no funny characters or non-sense)
When running the website locally or on a server we receive different effects from the exception being thrown.
Locally: The proper exception is displayed in BlockUI.
Server: The message "Runtime Error" is displayed instead of the exception message.
public ActionResult FailUpdateStatus(string id)
string message = Request.Form["message"];
throw new Exception(message);
By default, ASP.NET web applications will hide errors from remote machines accessing the site, and will only return the generic 'Runtime Error'. ASP.NET will only show application specific error messages when the site is accessed locally (i.e. if the ASP.NET application server is running on your local development machine, or if you open up a web browser on the server hosting the ASP.NET web application).
To view messages generated on a remote server from a local client, add the following code to your web.config file.