forum

Home / DeveloperSection / Forums / How Can ASP.Net MVC controller return an Image?

How Can ASP.Net MVC controller return an Image?

Mark M 2337 22-Jan-2015

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:

www.mywebsite.com/resource/image/topbanner

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?


Updated on 22-Jan-2015

Can you answer this question?


Answer

1 Answers

Liked By