Cpo Design

How to return empty result in mvc

Pavel Svarc Sunday, January 3, 2016 1:11 PM

How to return empty result in MVC

I have been surprised how many questions has been on stack overflow about this. And therefore I have decided to create a blog post about this.


Short answer is:


return EmptyResult();


Full example code:


 public ActionResult Empty()
        return new EmptyResult();

More information about empty result can be found on: https://msdn.microsoft.com/en-us/library/system.web.mvc.emptyresult.emptyresult.aspx#M:System.Web.Mvc.EmptyResult.

Related posts

Currenlty there are no related articles.