如何设置fileupload控件的filename属性 [英] How do I.set the filename property of a fileupload control

查看:564
本文介绍了如何设置fileupload控件的filename属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像我们设置文本框的文本属性(例如textbox1.text =some text)一样,我想在ASP.Net中设置fileupload控件的filename属性。有没有人有这样的经历?

解决方案

不,对不起。你不能。



由于安全限制,这是不可能的。浏览器不允许这样做。

FileUpload 在用户进行选择时设置路径。



替代解决方案: - 使用 Lable 控件来显示文件路径,而不是 FileUpload control。 / BLOCKQUOTE>

Like we set the text property of text box (e.g textbox1.text="some text") I want to set filename property of a fileupload control in ASP.Net. Does anybody have such experience?

解决方案

No, sorry. You can't.

This is not possible due to Security Restrictions. Browsers don't allow this.
FileUpload is set with the path, when user make a selection.

Alternate solution:- use Lable control to display file path rather than FileUpload control.


这篇关于如何设置fileupload控件的filename属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆