【问题标题】:how to bind function processing with updateprogress control in asp.net?如何在 asp.net 中将函数处理与 updateprogress 控件绑定?
【发布时间】:2013-04-02 01:37:39
【问题描述】:

点击按钮功能不会被触发。为什么会这样。

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdateProgress ID="UpdateProgress1" runat="server"
                    AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>
        <asp:Image ID="Image1" runat="server" 
                   ImageUrl="~/images/ajax-progress.gif"
                   />
                <br />
                Please Wait. This will take few minutes.
    </ProgressTemplate>
</asp:UpdateProgress>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Button ID="btnUpdate" runat="server" 
                    Text="Update" 
                    onclick="btnUpdate_Click" 
                    Width="100px" />
    </ContentTemplate>
</asp:UpdatePanel>

后面的代码:

protected void btnUpdate_Click(object sender, EventArgs e)
{        
    trunc();
    ConsumerUpld(FileUpload1);     
}

ConsumerUpld(fileupld)函数更新数据库中的表

【问题讨论】:

    标签: asp.net database c#-4.0 updatepanel updateprogress


    【解决方案1】:

    一切都很好,所以我用btnUpdate.Text = "updated";替换它来测试你的代码

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        btnUpdate.Text = "updated";
        //trunc();
        //ConsumerUpld(FileUpload1);
    }
    

    一切运行顺利,因此您的问题在您调用的 2 个函数之一中。

    当异步回发期间发生错误时,它会显示在浏览器页面的按钮上(显示方式取决于您的浏览器)。您应该尝试使用断点调试它或注释掉更新面板以查看发生了什么。

    【讨论】:

      猜你喜欢
      • 2013-03-02
      • 1970-01-01
      • 2015-11-12
      • 2011-03-25
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      • 2010-10-16
      相关资源
      最近更新 更多