Results 1 to 3 of 3

Thread: Show uploaded image in an image control. Working with IE9?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Show uploaded image in an image control. Working with IE9?

    Hi,

    I am uploaded an image from a local drive and once the upload is complete I want to show the file in an image control. I don't know a lot about javascript and was hoping well rather praying someone could give me an example.

    Many Thanks,

    Jiggy

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Show uploaded image in an image control. Working with IE9?

    I have now got this working! Here is my code:-

    <script type="text/javascript">
    var ImageSrc = ""
    function uploaded(e, args) {
    ImageSrc = args[0].value;
    var pieces = ImageSrc.split('\\');
    ImageSrc = "Symbols/" + pieces[pieces.length - 1];
    var ImageFileName = document.getElementById("ctl00_ContentPlaceHolder1_txtFilename");
    ImageFileName.value = pieces[pieces.length - 1];
    }
    function completed(e, args) {
    $("#<%=imgPreview.ClientID%>").attr("src", ImageSrc);
    }
    </script>
    My new problem is when I click on a delete button it does a postback but then for some reason it executes this line of code which causes an error which it will. This function gets called on the onclientcompleted event of a file upload control:-

    $("#<%=imgPreview.ClientID%>").attr("src", ImageSrc);
    Thanks for any help,

    Jiggy

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Show uploaded image in an image control. Working with IE9?

    This was also sorted; I did not have my dialog code in the update panel and did not create a trigger for it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width