views:

31

answers:

1

Hi Guys,

I am looking for a good approach on how to do the below

I have a file server where i store all of images.

I need to display these images onto my webpage using jquery and ajax.

Can someone please advise on how to do the above i can do the reading of the image from file server using a web service hosted on the file server which will return a byte array of the image, but once i read the byte array then how do i display it on the web page using jquery and ajax.

Please adivse

Thanks

+1  A: 

Have a look at doing this with an HttpHandler. HttpHandler Example: http://www.wrox.com/WileyCDA/Section/id-291916.html

If your're using MVC have a look at: http://dotnet.dzone.com/news/goodbye-http-handler-hello?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fcss+(CSS+Zone)

Mark Redman
Mark, appreciate your reply but i already know how i can get teh image using ahandler but the thing which i could not figure out is how i can first make a ajax call using jquery to my handler and then once the response ia back how can i display it on the screen using jquery
Amit
Using jquery you can create/modify an <img> tag and set the src attribute to your HttpHandler/WebService/View URL.
Mark Redman