display image in a <img> control placed in iframe
hi all,
I'm trying to display an image in a <img> control which is placed inside an iframe. for this I'm using <asp:FileUpload> control..
how can I do it using javascript?? I have tried all the codes that has been given in almost all websites.. I hav really run out of resources..
guys, u can only help me ...
pls.. help me out .....
thanx in advance :-)
Re: display image in a <img> control placed in iframe
What exactly are you trying to do? You aren't being really clear.
Re: display image in a <img> control placed in iframe
Hi PeejAvery,
As I hav mentioned in my previous post, that I'm using a file upload control which is placed in an iframe. After I click the browse button and select an image, I would like to display that image in an <image> control which too is placed within the iframe.
The file upload control <tag> looks like this..
<input type="file" id="fileUserAttachment" runat="server" onchange="return StartFileChangeTimer();" />
And inside StartFileChangeTimer() function , I'm trying to display the image in the <image >control.. However, the code to display image is executing without any problem.. but the image is not being displayed..
The following code is what I have used to display the image..
var sFileName = document.getElementById('fileuploadControl').value;
sFileName = sFileName.replace(/\\/g,'/');
document.getElementById('imgControlID').style.display = 'block';
document.getElementById('imgControlID').src = sFileName ;
From this , can u tell me where I have gone wrong ???
any help would b much appreciated .. :-)
thanx PeejAvery
Re: display image in a <img> control placed in iframe
Are you using Internet Explorer? If so, that would explain its lack of functionality.
Microsoft removed the ability to show images if the src attribute points to the local machine (ie. c:\path\to\image.jpg).
Re: display image in a <img> control placed in iframe
its not possible to display an image using js.
u could better save the image to server and then relaod it.. a postback wil do that for u..
i think that may work.. just try it..