上传控件的奇怪问题

  
    
1 < iframe id = " file_upload " runat = " server " frameborder = " 0 " scrolling = " no " src = " ../upload_file.aspx " style = " width: 100%; height: 25px " ></ iframe >
2 < input id = " pic_path " type = " hidden " runat = " server " />
我最近做的项目里都需要用到这个控件。 之前一直都是
  
    
< script type = " text/javascript " >
function $(obj) {
return document.getElementById(obj);
}
function setPicValue() {
var doc
= $( " file_upload " ).contentWindow.document;
$(
" pic_path " ).value = doc.getElementById( " file_url " ).innerHTML;
var doc1
= $( " file_upload1 " ).contentWindow.document;
$(
" pic_path1 " ).value = doc1.getElementById( " file_url " ).innerHTML;
var doc2
= $( " file_upload2 " ).contentWindow.document;
$(
" pic_path2 " ).value = doc2.getElementById( " file_url " ).innerHTML;
var doc3
= $( " file_upload3 " ).contentWindow.document;
$(
" pic_path3 " ).value = doc3.getElementById( " file_url " ).innerHTML;
var doc4
= $( " file_upload4 " ).contentWindow.document;
$(
" pic_path4 " ).value = doc4.getElementById( " file_url " ).innerHTML;

}
</ script >
用这个function在提交按钮的OnClientClick事件中调用。一直没有出现问题。 但是今天后台怎么都拿不到pic_path的值。 一位高手告诉我说是因为File的安全机制问题。 提交的时候把File的值清空了。 但我在后台监视Request.Form的时候发现
  
    
Request.Form[ " pic_path " ]
这样子可以拿到值。  很让人费解。。 有谁深究过这个问题的  给解答一下

你可能感兴趣的:(上传)