Put an upload control and a picture control on the page.
Copy Code code as follows:
<asp:fileupload id= "FileUpload1" runat= "Server" onpropertychange= "Show (This.value)"/>
<asp:image id= "Image1" runat= "Server"/>
Write onpropertychange= "Show (This.value)" event in the upload control and call the show function in JS and pass the arguments to JS.
Copy Code code as follows:
<script type= "Text/javascript" >
function Show (ID)
... {
document.getElementById ("Image1"). Src=id;
}
</script>
IE6,IE7 test Pass (note to be implemented through filter)
Copy Code code as follows:
<div id= "Divview" style= "Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" (sizingmethod=image); width:166px; height:190px ">
<!--for displaying pictures-->
</div>
<asp:fileupload id= "FileUpload3" runat= "Server" onpropertychange= "Show1 (this.value)"/>
<script type= "Text/javascript" >
function Show1 (upimg)
... {
var Dd=document.getelementbyid ("Divview");
Dd.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader"). src = upimg;
Dd.style.width = 166;
Dd.style.height = 190;
Dd.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader"). Sizingmethod = scale;
}
</script>