本文介绍了如何获得的asp文件上传的JavaScript中的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获得ASP文件上传的JavaScript中的价值。我尝试,但难道不能够得到两个文件上传的价值。
函数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; 警报(frontvalue);
警报(backvalue); }
解决方案
如果<$c$c>ctl01_uxPlaceHolder_uxProductFormView_ctl01_uxOptionGroupDetails_uxOptionDataList_ctl00_uxOptionItemDetails_uxOptionUploadItem_uxUploadFile$c$c>该ID那么它应该工作。
其他明智地使用客户端编号
VAR firstvalue =的document.getElementById(&LT;%= uxUploadFile.ClientID%GT;);
警报(firstvalue);
How to get the value of asp fileupload in javascript. I tried but wouldnt able to get the value of two file uploads.
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);
}
解决方案
If ctl01_uxPlaceHolder_uxProductFormView_ctl01_uxOptionGroupDetails_uxOptionDataList_ctl00_uxOptionItemDetails_uxOptionUploadItem_uxUploadFile
the id then it should work.
Other wise use client Id
var firstvalue = document.getElementById("<%= uxUploadFile.ClientID %>");
alert(firstvalue);
这篇关于如何获得的asp文件上传的JavaScript中的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!