Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want display image in image control of asp.net immediateky after browsing from file uploader control withot any button click .
taht means when i am browse image from fileuploader it immediately display in image control
Posted
Comments
bhagirathimfs 20-Jun-12 4:06am    
You want to upload an image , but before upload u want to show the image ???

 
Share this answer
 
when i am browse image from fileuploader it immediately display in image control
Not possible. You need some event to trigger the display of the selected item.
 
Share this answer
 
IT IS Possible WITH AJAX

<asp:asyncfileupload id="AsyncFileUpload1" runat="server" width="200px" onclientuploadcomplete="uploadComplete" />

<img id="img_display" src="" alt="" height="50" width="50" />

<script type="text/javascript">

function uploadComplete(sender, args)
{

var imgDisplay = document.getElementById("img_display");

imgDisplay.src = "../upload/" + args.get_fileName();

}


</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900