在updatepanel中上传带文件上传控件的文件时显示进度条 [英] show progress bar while uploading file with file upload control in updatepanel

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

问题描述

您好b $ b

我需要知道如何在上传使用文件上传控件时显示进度条。

如果我使用按钮如



 <  触发器 >  
< asp:PostBackTrigger ControlID = btnSave / >
< / Triggers >







文件正在上传但进度条没有显示。

如果我使用的话没有postbacktrigger进度条的按钮正在显示,但是如果(FUUpload.HasFile)

变为false,那么我无法上传文件。 />


我想同时使用进度条和文件上传控件。任何1请给我一个解决方案来解决这个问题。



这是aspx代码:



 <   asp:updatepanel     id   =  UPFileupload    runat   =  server    updatemode   = 有条件的  >  
< contenttemplate >
< div id = DivFup runat = server 可见 = false >
< asp:Panel ID = < span class =code-keyword> Panel2 runat = server >
< table >
< tr >
< td class = field align = <跨越式s =code-keyword> left >
< asp:FileUpload ID = FUUpload runat = server 宽度 = 180% / > < br / >
< / td >

< td class = field align = right width = < span class =code-keyword> 171 >

< ; asp:按钮 CssClass = formbutton ID = BTNImport TabIndex = 9 runat = server 文本 = 上传

OnClick = BTNImport_Click > < / asp:Button >

< / td >
< td > < span class =code-keyword><
/ td >
< / tr >
< / table >
< / asp:Panel > ;
< / div >
< / contenttemplate >
< 触发器 >
< asp:PostBackTrigger ControlID = BTNImport / >
< / Triggers >

< / asp:updatepanel >





在哪里我想进行更改以使其完美运作?



提前致谢。

解决方案

Hi
I need to know how to show progress bar while uploading the using file upload control.
if i use button like

<Triggers>
                      <asp:PostBackTrigger ControlID = "btnSave" />
              </Triggers>




file was uploading but progress bar is not displaying.
if i use button without postbacktrigger progress bar is displaying but

if (FUUpload.HasFile)

becomes false so that i'm unable to upload the file.

I want to use both progressbar as well as file upload control together.can any 1 please give me a solution to come out from this issue.

Here is aspx code:

<asp:updatepanel id="UPFileupload" runat="server" updatemode="Conditional">
            <contenttemplate>
                    <div id="DivFup" runat="server" visible="false">
                        <asp:Panel ID="Panel2" runat="server" >
                                <table>
                                        <tr>
                                           <td class="field" align="left">
                                              <asp:FileUpload ID="FUUpload" runat="server" Width="180%"/><br />
                                           </td>

                                            <td class="field" align="right" width="171">

                                                <asp:Button CssClass="formbutton" ID="BTNImport" TabIndex="9" runat="server" Text="Upload"

                                                    OnClick="BTNImport_Click"></asp:Button>

                                           </td>
                     <td></td>
                                      </tr>
                                   </table>
                        </asp:Panel>
                    </div>
            </contenttemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID = "BTNImport"/>
            </Triggers>

       </asp:updatepanel>



where i want to make changes to make it to work perfect?

Thanks in advance.

解决方案

这篇关于在updatepanel中上传带文件上传控件的文件时显示进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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