Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. load images without postback

load images without postback

Scheduled Pinned Locked Moved Web Development
questionsysadminxml
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _crs_
    wrote on last edited by
    #1

    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.

    C D 2 Replies Last reply
    0
    • _ _crs_

      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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      _ 1 Reply Last reply
      0
      • C Christian Graus

        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 )

        _ Offline
        _ Offline
        _crs_
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • _ _crs_

          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.

          D Offline
          D Offline
          DavidNohejl
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups