Is there an ASP.NET MVC controller or helper class that can automatically return the proper HTTP response based on the HTTP request header? I’d like it to be able to return JSON, XML, or a View based on the request’s content type, with the only thing I have to do is populate some global Model object with data from the database.
Is there an ASP.NET MVC controller or helper class that can automatically return the
Share
Check out this article – you can do it using action filters: