<td height="20" bgcolor="#FFFFFF"><div align="center">
<span style="font-size: 9pt"><img id= "img" name= "img" src= " " alt= "图片 "/></span></div></td>
<td bgcolor="#FFFFFF" colspan="2"><span class="STYLE5"></span><span class="STYLE5">
asp:FileUpload ID="fulImg" runat="server" onpropertychange= "javascript:this.value!= ' '? img.src=this.value: ' '; "
style="width:250px; height:17px; border:solid 1px #7dbad7; font-size:12px; background-color:White;" TabIndex="11" /></span></td>
到底是什么地方写错了 ,为什么不改变呢!?但是右击图片 属性中name 都改变了呀 就是图片不显示!
<span style="font-size: 9pt"><img id= "img" name= "img" src= " " alt= "图片 "/></span></div></td>
<td bgcolor="#FFFFFF" colspan="2"><span class="STYLE5"></span><span class="STYLE5">
asp:FileUpload ID="fulImg" runat="server" onpropertychange= "javascript:this.value!= ' '? img.src=this.value: ' '; "
style="width:250px; height:17px; border:solid 1px #7dbad7; font-size:12px; background-color:White;" TabIndex="11" /></span></td>
到底是什么地方写错了 ,为什么不改变呢!?但是右击图片 属性中name 都改变了呀 就是图片不显示!
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<script type="text/javascript"> function Preview(imgFile)
{
document.getElementById("img1").filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value; }
</script> <input id="File1" type="file" onchange="Preview(this);" runat="server" />
<div id="img1" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:400px;height:300px;"> </div>
</div>
</form>
</body>
</html>
style="width: 243px;" />
function PreviewImg1(imgFile) {
var mo_InvheadPicN = "<%=mo_InvheadPic1 %>";
var mo_InvheadPicY = "<%=mo_InvheadPic2 %>";
if (imgFile.value == "") {
var message = " <img src=" + mo_InvheadPicN + " /><font color=red>请上传头像图片</font>";
document.getElementById("LbMessage").innerHTML = message;
}
var ext = imgFile.value.toLowerCase().substring(imgFile.value.length - 3, imgFile.value.length);
if (ext == "jpg" || ext == "gif" || ext == "bmp") {
var icohd1 = document.getElementById('icohd1');
icohd1.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
icohd1.style.width = "93px";
icohd1.style.height = "96px";
document.getElementById("img1").style.display = "none";
var icohd2 = document.getElementById('icohd2');
icohd2.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
icohd2.style.width = "78px";
icohd2.style.height = "76px";
document.getElementById("img2").style.display = "none";
var icohd3 = document.getElementById('icohd3');
icohd3.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
icohd3.style.width = "78px";
icohd3.style.height = "80px";
document.getElementById("img3").style.display = "none";
var icohd4 = document.getElementById('icohd4');
icohd4.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
icohd4.style.width = "78px";
icohd4.style.height = "80px";
document.getElementById("img4").style.display = "none";
var icohd5 = document.getElementById('icohd5');
icohd5.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
icohd5.style.width = "120px";
icohd5.style.height = "115px";
document.getElementById("img5").style.display = "none";
}
else {
document.getElementById("img1").src = "";
document.getElementById("img2").src = "";
document.getElementById("img3").src = "";
document.getElementById("img4").src = "";
document.getElementById("img5").src = "";
var message = " <img src=" + mo_InvheadPicN + " /><font color=red>图片格式错误</font>";
document.getElementById("LbMessage").innerHTML = message;
}
if (imgFile.value != "" && (ext == "jpg" || ext == "gif" || ext == "bmp")) {
var message = " <img src=" + mo_InvheadPicY + " /><font color=green>上传成功</font>";
document.getElementById("LbMessage").innerHTML = message;
}