页面回传后文件上传文件名丢失 [英] file upload filename get lost after page postback

查看:80
本文介绍了页面回传后文件上传文件名丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次回发后我在asp.net中使用fileupload控件时,我都应该再次上传文件,而filename属性不会保留.
我该怎么办.

when i use fileupload control in asp.net after each post back i should upload the file again and the filename property won''t stay.
what can i do with this problem.

推荐答案

Due to some security reason FileUpload control will not keep the value during postback. It works in the same way as password field. So keep the fileupload control out of the update panel first and also dont expect the file path selected will keep during post back. As a work around what you can do is save the file path selected in a viewstate or session or hidden field to use it later.


这篇关于页面回传后文件上传文件名丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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