指定文件路径FileUpload控件 [英] Assign file path to FileUpload Control

查看:454
本文介绍了指定文件路径FileUpload控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何分配文件路径FileUpload控件在VS 2005?

How can i assign file path to FileUpload Control in VS 2005?

为什么我需要?:因为,当我编辑的GridView一排,FileUpload控件变为空白(我认为这是正确的,但客户端不!)和验证抛出说:文件中载没有选择。

Why i need that?: 'cause, when i edit a row in GridView, the fileupload control becomes blank (which i believe is correct but client doesn't!!!) and a validation is thrown saying "File to be upload is not selected".

推荐答案

这是不可能的,由于安全限制。设置在FileUpload控件该属性的唯一方法是让用户进行选择。

This is not possible due to security restrictions. The only way to set that property on the FileUpload control is to have the user make a selection.

但其他的解决办法是利用拉布勒控件来显示文件的路径,而不是文件上传控制。
并在使用时单击上传文件,隐藏拉布勒并显示文件上传控件。

But other solution is make use of lable control to display file path rather than file upload control. and when use click to upload file hide lable and display file upload control.

这篇关于指定文件路径FileUpload控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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