load images without postback
-
Hi, Can you plase give me a hint .... I want to load an image (jpeg) from the server generated by an aspx without postback, so i created an XMLHTTPRequest oject, I run the aspx, the responeXML is an XML and the image is base64 encoded inside a node... (i can see the string in my page) how can i display it ? So i need someking of javascipt to decode it ? Am I on the right track ? Thank you! iulian.
-
Hi, Can you plase give me a hint .... I want to load an image (jpeg) from the server generated by an aspx without postback, so i created an XMLHTTPRequest oject, I run the aspx, the responeXML is an XML and the image is base64 encoded inside a node... (i can see the string in my page) how can i display it ? So i need someking of javascipt to decode it ? Am I on the right track ? Thank you! iulian.
No, I don't think so. I think the right approach here is to use AJAX to send down the path to the image, and then use javascript to set the properties of an IMG tag on the page.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
No, I don't think so. I think the right approach here is to use AJAX to send down the path to the image, and then use javascript to set the properties of an IMG tag on the page.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
it's ok what you say but i want the image to be dynamicaly generated based on user inputs so ... if i generate the picture and save it on disk and then send the link to the client to retrieve it i will have hundrads of useless generated pictures on the server ?? my ideea was to dynamicaly generate the picture and send it to the user (the actual data) ??? can i do that ? thanks
-
Hi, Can you plase give me a hint .... I want to load an image (jpeg) from the server generated by an aspx without postback, so i created an XMLHTTPRequest oject, I run the aspx, the responeXML is an XML and the image is base64 encoded inside a node... (i can see the string in my page) how can i display it ? So i need someking of javascipt to decode it ? Am I on the right track ? Thank you! iulian.
If I understand what you are doing, problem is that you can't "write" picture into page. Pictures are NOT part of the page. What you need to do is generate your .jpg file on server, and using ajax set the image source to something like <img src="givemepicture.aspx?picture" /> And givemepicture.aspx will write your image (probably generated using parameters passed in url) into its response. I don't know if the browser will automaticaly reload image after you change it's src with javascript.
[My Blog]
"Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - RĂ¼diger Klaehn
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe