How Can ASP.Net MVC controller return an Image?

Mark M

Total Post:28


Posted by  Mark M
 1763  View(s)
Rate this:

Can I create a Controller that simply returns an image asset?

I would like to route this logic through a controller, whenever a url such as the following is requested:

The controller will look up topbanner.png and send that image directly back to the client.

I've seen examples of this where you have to create a View - I don't want to use a View. I want to do it all with just the Controller.

Is this possible?


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.