forum

home / developersection / forums / hoe to return image in asp.net mvc?

Hoe to return image in asp.net mvc?

marcel ethan 2092 18-Nov-2014

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 18-Nov-2014
Can you answer this question?

Answer

1 Answers

Liked By