-
Aug 21st, 2013, 03:17 AM
#1
Thread Starter
Frenzied Member
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
-
Aug 21st, 2013, 06:57 AM
#2
Thread Starter
Frenzied Member
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
-
Aug 27th, 2013, 02:50 AM
#3
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|