【问题标题】:How to Execute two update panels in a page Asynchronously at a time?如何一次异步执行页面中的两个更新面板?
【发布时间】:2012-06-01 07:34:48
【问题描述】:

我在 asp.net 页面中有 2 个更新面板,在更新面板中有一个文本框和 asp 按钮可用,用户输入文本框并依次单击按钮,第一个请求发送到一个类方法(需要 5 秒时间) 和第二个请求发送另一个类方法(需要 10 秒时间)但是现在用户单击第一个按钮而不等待响应立即单击第二个按钮,我已经发送了两个请求并独立显示响应(这意味着异步) 请给我任何建议

【问题讨论】:

  • 为什么不禁用第二个按钮并在第一个异步请求完成时启用它

标签: c# asp.net asynchronous updatepanel


【解决方案1】:

使用 UpdateProgress 控件:

Update Process

<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:UpdateProgress runat="server" id="PageUpdateProgress">
            <ProgressTemplate>
                Loading...
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel runat="server" id="Panel">
            <ContentTemplate>
                <asp:Button runat="server" id="UpdateButton" onclick="UpdateButton_Click" text="Update" />
            </ContentTemplate>
        </asp:UpdatePanel>

【讨论】:

    猜你喜欢
    • 2010-12-23
    • 1970-01-01
    • 1970-01-01
    • 2011-08-24
    • 1970-01-01
    • 2017-11-09
    • 1970-01-01
    • 1970-01-01
    • 2011-12-08
    相关资源
    最近更新 更多