Fileupload控件在回发时丢失了值 [英] Fileupload control looses value on postback

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

问题描述

我有webform有以下结构。第一个更新面板具有fileupload控件。第二个更新面板有下拉列表以及一个包含textbox的面板。下拉列表的选定索引更改,面板变为可见(文本框变为可见)。但是当我使用fileupload浏览文件时,我选择从dropdownlist中选择一个值,fileupload control失去了价值。如何处理?2更新面板后一个日历控件和一个按钮控件。我想保存并从按钮控件事件中读取文件



I have webform having following structure. First update panel have fileupload control. Second update panel have dropdownlist along with one panel which contain textbox.Onselected index change of dropdownlist,panel get visible(textbox get visible).But when I browse the file using fileupload and after that I choose to select a value from dropdownlist, fileupload control looses the value. How to handle that?After 2 update panel one calendar control and one button control.I want to save and read the file from button control event

// Update panel 1 start
   // fileupload control
// update panel 1 end 


// Update panel 2 start
   // dropdownlist with selected index change event
   // On selected index change textbox get visible
// update panel 2 end 

// Calender control
// Generate button





我的尝试:





What I have tried:

// Update panel 1 start
   // fileupload control
// update panel 1 end 


// Update panel 2 start
   // dropdownlist with selected index change event
   // On selected index change textbox get visible
// update panel 2 end 

// Calender control
// Generate button

推荐答案

文件上载控件在内部无效无论如何更新面板所以没有意义。如果在文件上载周围删除它会解决问题,那就这样做。
The fileupload control doesn't work inside an update panel anyway so there is no point in having it. If removing it around the fileupload fixes the problem then just do that.


这篇关于Fileupload控件在回发时丢失了值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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