hi friends,
i want to generate preview before uploading it in website. To do that i try...
<script type="text/javascript">
function abc() {
var path = document.getElementById("FileUpload1").value;
document.getElementById("Image1").src = path;
}
script>
//page....
<
div><asp:FileUpload ID="FileUpload1" runat="server" />
<br />
<asp:Image ID="Image1" AlternateText="Preview" runat="server" onchange="abc()" Height="191px" Width="173px" />div>
but it didn't works....
please help me
Thankyou in advance....
Pardeep Malik
Loading


Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 16, 2013, 12:39 AM EDT
Pardeep Malik129 reputationPosted May 4, 2013, 12:04 AM EDT
But my frnd m looking for something else. i want to show preview with java script or else with the help of popup. so if you have any batter way tell me.
again thanks for your support
Raj BandiRank #1,603 · 981 reputationPosted May 5, 2013, 12:02 AM EDT
I'm not sure about browser requirements(crossbrowser or specific browsers).
Try with FileReader object if you are dealing with IE10, FF, Chrome. IE7-8 needs a different approach.
Let me know if you need sample code
Cheers,
Raj
Lalit Raghuvanshi50 reputationPosted Jun 14, 2014, 9:52 AM EDT
SaiRoja50 reputationPosted Sep 21, 2014, 10:59 PM EDT
http://aspdotnet-kishore.blogspot.in/2014/09/preview-image-before-upload-using.html