//判断浏览器类型
var isIE = (document.all) ? true : false;
var isIE7 = isIE &&(navigator.userAgent.indexOf('MSIE 7.0') != -1);
var isIE8 = isIE &&(navigator.userAgent.indexOf('MSIE 8.0') != -1);
var file = document.getElementByIdx_x("fupFile");
var path = "";
if (isIE7 || isIE8) {
file.select();
path = document.selection.createRange().text;
document.selection.empty();
}
else
{
path=file.value;
}
<asp:FileUpload ID="fupPhoto" runat="server"onpropertychange="ShowImage()"/>
function ShowImage() {
//判断浏览器类型
var isIE = (document.all) ? true : false;
var isIE7 = isIE &&(navigator.userAgent.indexOf('MSIE 7.0') != -1);
var isIE8 = isIE &&(navigator.userAgent.indexOf('MSIE 8.0') != -1);
var file = document.getElementByIdx_x("fupPhoto");
var path = "";
if (isIE7 || isIE8) {
file.select();
path = document.selection.createRange().text;
document.selection.empty();
}
else {
path = file.value;
}
//document.getElementByIdx_x("hidImagePath").value = path;
//document.getElementByIdx_x("btnHiddentPhoto").click();
//
document.getElementByIdx_x("imgPhoto").src = path;
}