I have Ajax.BeginForm with OnSuccess & OnFailure javascript handlers.
How do fail from my controller so that OnFailure is called?
Yes, I used to call throw new HttpException(404) and it used to work.
But now, I have set a custom error handler that calls Server.ClearError(). Due to this Ajax.BeginForm thinks that no error has occurred.
I am using the error handler given here: ASP.NET MVC Custom Error Handling Application_Error Global.asax?