I am having a trying problem with a project I'm working on using ASP.NET MVC. I have an ActionResult which is called by jQuery ajax which posts a file to be saved in a temporary folder, the original view which contains the form and jQuery code is called "New".
I try to validate the filetype within the ActionResult which is called by the ajax file uploader. If the validation fails I add an error entry in the model error in the model state and try to return the original view hopefully displying the error to the user.
This unfortunately returns 2 of the same views one on top of the other with the valid error message, which is obviously not what I require. I have tried returning null instead of a viewresult, This stops the problem of multipe views being returned, but unfortunately the modelstate error message is not displayed.
Has anyone got any tips to help fix this issue?