在回发时将文本框控件中FileUpload的完整文件路径分配回FileUpload [英] Assign full file path of FileUpload in textbox control back to FileUpload on postback
本文介绍了在回发时将文本框控件中FileUpload的完整文件路径分配回FileUpload的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在UpdatePanel中有一个FileUpload控件,当用户选择文件时,完整文件路径将存储在hiddenfield中,并且在回发期间,我想将hiddenfield中的完整文件路径分配回FileUpload控制文本框,有可能实现吗?
I have a FileUpload control in an UpdatePanel and when user select a file, the full file path will will be stored in a hiddenfield, and during postback, i would like to assign the full file path in the hiddenfield back to the FileUpload control textbox, possible to achieve that?
推荐答案
这是不可能的,因为您无法为FileUpload控件分配文件路径.浏览器不允许这样做,因为这会带来安全风险.
That is not possible because you cannot assign a file path to the FileUpload control. Browsers don't allow that because it would be a security risk.
这篇关于在回发时将文本框控件中FileUpload的完整文件路径分配回FileUpload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文