1

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?

RajeshKdev
  • 6,365
  • 6
  • 58
  • 80
Shoreki
  • 1,057
  • 4
  • 14
  • 33
  • 1
    Define "fix". What do you want to happen? – CodeCaster May 06 '13 at 09:48
  • 2
    Related [Why does System.Web.Mvc.HandleErrorInfo get passed to my views?](http://stackoverflow.com/questions/1997396/argh-why-does-system-web-mvc-handleerrorinfo-get-passed-to-my-views) – Martin Smith May 06 '13 at 09:55
  • @CodeCaster: I need to show my custom error message. Now in the production server, I am getting the error message that is shown above. – Shoreki May 06 '13 at 10:56
  • can you post some more code to elaborate your problem ? – Rohit416 May 06 '13 at 12:27

0 Answers0