上传文件字段 [英] Upload file field

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

问题描述

嘿大家。


我的上传输入控件有问题。我的表单包含输入控件日历和复选框,其中包含显示文本字段的条件。我可以正常进行文件选择,它将显示在文本字段中。但是,如果我在此之后从我的日历中选择一个日期或选中一个条件复选框,则所选的上传文件将从文本字段中消失。所以用户必须再次选择该文件。


有没有人知道这个问题的原因或解决方案?

解决方案

I相信你有一个回发问题,并且可能需要在page_load中使用Not Page.IsPostBack ...


希望这会有所帮助。


谢谢为了答案。我不完全确定我是否知道你的意思。我在开头或页面上有以下代码


private void Page_Load(object sender,System.EventArgs e)

{

if(!Page.IsPostBack)

{

//包含用于打开SQL连接的字符串

}


所有条件控件都是单独的私有函数。


认为回发或视图状态可能有问题...文本框是否只读设置为true?

Hey everybody.

I have problem with my upload input control. My form contains input controls calendars and check boxes with conditions to show text field. I can do the file selection normally and it will be shown in a text field. However if I after this choose a date from my calendar or check a conditioned check box the chosen upload file disappears from text field. So user has to choose the file again.

Does anyone know cause or a solution for this problem?

解决方案

I believe that you have a postback problem and may need a Not Page.IsPostBack in the page_load...

Hope that this helps.


Thanks for the answer. I''m not totally sure if I know what you mean by that. I have following code on the beginning or the page

private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
//contains strings for opening SQL connection
}

All the conditioned controls are separately on their private functions.


Thought that there may be a problem with postback or viewstate... Is the textbox readonly set to true?


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

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