如何在javascript中获取asp fileupload的值。我试过但是无法获得两个文件上传的价值。
function alertupload() {>
var firstvalue = document.getElementById("ctl01_uxPlaceHolder_uxProductFormView_ctl01_uxOptionGroupDetails_uxOptionDataList_ctl00_uxOptionItemDetails_uxOptionUploadItem_uxUploadFile").value;
var backvalue = document.getElementById("ctl01_uxPlaceHolder_uxProductFormView_ctl01_uxOptionGroupDetails_uxOptionDataList_ctl01_uxOptionItemDetails_uxOptionUploadItem_uxUploadFile").value;
alert(frontvalue);
alert(backvalue);
}
答案 0 :(得分:0)
如果ctl01_uxPlaceHolder_uxProductFormView_ctl01_uxOptionGroupDetails_uxOptionDataList_ctl00_uxOptionItemDetails_uxOptionUploadItem_uxUploadFile
为id,那么它应该有效。
其他明智的使用客户端ID
var firstvalue = document.getElementById("<%= uxUploadFile.ClientID %>");
alert(firstvalue);