页面上有一个Button按纽和fileupload控件,是上传大批量数据到db中去的,当点击按纽执行insert的时候会执行很久,我想在执行的时候显示让用户知道在插入数据,想用updatepanel和updateprogress,但是把button放在updatepanel就直接挂了,好像是页面又上传控件。
我想咨询一下大侠如何做到我想要的效果,应该弹出一个div可以做到,只是不太熟,高手写写让我学习下!

解决方案 »

  1.   

    button1.Enable=false
    label1.text="正在上传"
      

  2.   

    CSDN 资源下载 asp.net2.0 c#上传文件(含进度条) 
      

  3.   

    把button放在updatepanel外面试试,用一个trigger挂钩
      

  4.   

    用updatepanel和updateprogress可以的
    不知你的挂了是什么意思<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            //模拟你插入数据
            System.Threading.Thread.Sleep(10000);
            //insert
        }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
            正在加载...
            </ProgressTemplate>
        </asp:UpdateProgress>
        </form>
    </body>
    </html>
      

  5.   

    因为btn事件里有对fileupload控件的操作,直接就报异常了,我查过,结果好像是fileupload不能和updatapanel一起使用