在文件上传控件中保留值 [英] Retain value in fileupload control

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

问题描述

我正在编写一个文件上传应用程序.所以它在文本框中包含一个键名和一个文件上传控制.保存按钮用于保存键名和文件.我的问题是当我在文件上传控件中选择一个文件并且我没有在键名文本框中输入任何值并单击保存按钮时,会显示一条消息输入键名"但文件上传控件被清除.文件上传控件中的值如何保留?

I am writing a file upload application. So it contains a keyname in textbox and a fileupload control. A save button is used to save the keyname and the file. My issue is when I select a file in fileupload control and I donot enter any value in keyname textbox and click on save button, a message is shown 'enter a keyname' but the fileupload control is cleared. How can retain the value in the fileupload control?

推荐答案

您不能在 FileUpload 控件中保留值.这是出于安全原因.您可以将 RequiredFieldValidator 用于键名文本框.

You can't retain value in FileUpload control. This is because of security reasons. you can use RequiredFieldValidator for keyname textbox.

这篇关于在文件上传控件中保留值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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