<img id="Img1" src="default.png"/>
<input type="file" onpropertychange="document.all.Img1.src='file:///'+this.value" id="FileUpload2" runat="server" name="FileUpload2" class="utxt"/>
用onpropertychangeg才能捕获改变
============================================
另存为html 单独打开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head><title>
</title><meta name="keywords" /><meta name="description" /></head>
<body>
<form name="Form1" method="post" action="Default.aspx" id="Form1" enctype="multipart/form-data">
<div>
</div>
<div align="left">
<input name="uploadFile" type="file" id="uploadFile" onpropertychange="getImg(this)" /></div>
[最好使用XXX00*XXXXX的图片]<br>
<div align="left">
<img id="myimg" height="100" src="images\showimg.gif" width="100" border="0"></div>
<script language="javascript" type="text/javascript">
function getImg(obj){
var img = document.getElementById("myimg");
img.src = 'file:///'+obj.value;
//alert(obj.value);
}
</script>
</form>
</body>
</html>