Check model's ModelState in FileStreamResult action in ASP.NET MVC

Posted by fishiefishie on Stack Overflow See other posts from Stack Overflow or by fishiefishie
Published on 2010-05-11T20:37:12Z Indexed on 2010/05/11 20:54 UTC
Read the original article Hit count: 290

Filed under:

I have a page that a user selects what he wants to download, the submit button posts the form to

public FileStreamResult GetFiles(FileSelectionModel model)
{
   //zips files into one zip
   return File();
}

However, what if the model wasn't in a valid state? How do I check it? It wouldn't let me return View() or return RedirectToAction() here

thanks

© Stack Overflow or respective owner

Related posts about asp.net-mvc