To show a custom error message, I wrote the following simple code in the Controller:
if (rValue == -1)
{
throw new ApplicationException("An error occured.");
}
This works fine in localhost. But when installed in the production IIS server, I am gettnig an error
The model item passed into the dictionary is of type 'System.Web.Mvc.HandleErrorInfo', but this dictionary requires a model item of type 'workTable.Models.SchedulerModel.
I am using C#/razor/MVC3. Getting the same error when I throw the Excepton from .cshtml file. How can I fix this?