使用FindFile.Attributes.Add("Value", FindFile.PostedFile.FileName);也没作用

解决方案 »

  1.   

    这样是不行的。要在页面用javascript来设置。
      

  2.   

    若是2005,你用WEB上传控件,若是2003,应该没你说的那种问题
      

  3.   

    to:这样是不行的。要在页面用javascript来设置。
    js要怎么写
      

  4.   

    改控件的vaule值是不是不能设置啊  
     function FileContent()
        {
           alert('1');
           
           
           window.document.Form1.fileFaxNo.value = "12344";

           alert(window.document.Form1.fileFaxNo.value);
           
        }
    我调用上面这个function 还是个空值啊
    这个要怎么解决啊
      

  5.   

    this function seems difficult to achieve.
    u can also notice an HTML <input type="file"> element in source.if u delete type="file" u can set its value.on the other hand,u cann't set it.
      

  6.   

    比我好了,我的连PostedFile方法都不能用,还不知道怎么回事呢
      

  7.   

    据我了解也是,不能在运行时指定FileUpload控件的值
      

  8.   

    你们估计没有用过一种方法 wscript的sendkeys 可以给个假的值
    <form name="form1" id="form1">
    <input type="file" name="T1" id="T1" />
    </form>
    <script  language=javascript>  
    function  window.onload()  
    {  
           document.form1.T1.focus();  
           var  WshShell=new  ActiveXObject("WScript.Shell");  
           WshShell.sendKeys("c:\\test.txt");  //向文本框里发送东东  
    }  
    </script>  
    参考我写的blog
      

  9.   

    http://blog.csdn.net/liuxiaoyi666/archive/2005/01/17/257209.aspx
      

  10.   

    <script  language=javascript>  
    function  window.onload()  
    {  
    document.Form1.FindFile.focus();  
    var  WshShell=new  ActiveXObject("WScript.Shell");
    WshShell.sendKeys("c:\\test.txt");  //向文本框里发送东东   }  
    </script>  
    这个不行啊  报错 automation服务器不能不能创建对象啊有runat=server也不行我就是想在点击按钮执行操作后,该控件中的值不会消失
      

  11.   

    不要钻牛角尖了。从安全角度讲,是不允许的。
    下面这种也是旁门左道,不用去试了。
    说不定今天你实现了,明天IE打上补丁,又不让你用了。<script  language=javascript>  
    function  window.onload()  
    {  
    document.Form1.FindFile.focus();  
    var  WshShell=new  ActiveXObject("WScript.Shell");
    WshShell.sendKeys("c:\\test.txt");  //向文本框里发送东东   }  
    </script>  
      

  12.   

    btw:说runat的,全部都是胡说八道,不懂别乱说,NND
      

  13.   

    你改了设置照我的方法做,否则还有办法就是照着我的blog列出若干bt的方法做...