文件上传更新面板内失去在asp.net文件 [英] file upload inside update panel loses the file in asp.net

查看:144
本文介绍了文件上传更新面板内失去在asp.net文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个更新面板在一个页面,每当值从下拉列表框中选择我在页面上显示的一些文字,我已经设置触发器下拉,即使这样做的页面做了后回来时,我后改变下拉值,我要去哪里错了。

I have a update panel in a page and Whenever a value is selected from the dropdown box I display some text on the page, I have set triggers for the drop down, even after doing it the page does a post back when i change the drop down value, where am i going wrong

 <asp:UpdatePanel ID="UP_DDL" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
    <ContentTemplate>
          <asp:FileUpload ID="File_Audio" runat="server"  />
          <asp:DropDownList ID="ddl_SendAt" runat="server" AutoPostBack="true" 
                                            OnSelectedIndexChanged="ddl2_SelectedIndexChanged">
           <asp:ListItem Selected="True">Now</asp:ListItem>
           <asp:ListItem>After 1 Hour</asp:ListItem>
             </ContentTemplate>
      <Triggers>
          <asp:AsyncPostBackTrigger ControlID="ddl_SendAt" EventName="SelectedIndexChanged" />                                
      </Triggers>
 </asp:UpdatePanel>

我想将DropDownList做一个回传显示在文本框中的内容,但我有一个文件上传按钮也。当我选择从计算机中的文件,并更改下拉列表回发发生,文件上传丢失文件

I want the DropDownList to make a postback to display contents in text box, but I have a file upload button as well. When I select a file from computer and change the dropdown list a post back happens and the file upload loses the file

推荐答案

我bascially不建议里面一个UpdatePanel一个FileUpload控件。文件上传,通常需要一个完整的回发。

I would bascially not recommend a FileUpload control inside an UpdatePanel. A file upload normally needs a full postback.

除非你实现你的文件上传一个框架。

Except if you implement your file upload inside a frame.

这篇关于文件上传更新面板内失去在asp.net文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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