设置 AssociatedUpdatePanelID 时 Updateprogessbar 不起作用?

发布于 2024-07-29 03:37:03 字数 1694 浏览 3 评论 0原文

我的页面上有两个更新面板和一个进度条。 如果我设置 AssociatedUpdatePanelID,则进度条无法工作,如果不设置 AssociatedUpdatePanelID,进度条可以工作,但问题适用于两个 updatepanel。 但我需要在一个更新面板上工作。

 <asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" />
    <asp:Button ID="Button2" runat="server" Text="Button2" OnClick="Button2_Click" />
    <asp:UpdateProgress runat="server" ID="prg" AssociatedUpdatePanelID="upnl">
        <ProgressTemplate>
            <img src="Images/progressbar.gif" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    <asp:UpdatePanel runat="server" ID="upnl" UpdateMode="Conditional">
        <ContentTemplate>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="upnl1" UpdateMode="Conditional">
        <ContentTemplate>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>

Code Behind - C#

protected void Button1_Click(object sender, EventArgs e)
{
    System.Threading.Thread.Sleep(3000);
}
protected void Button2_Click(object sender, EventArgs e)
{
    System.Threading.Thread.Sleep(3000);
}

在这个视频中,他也没有设置 AssociatedUpdatePanelID http://www.asp.net/learn/ajax-videos/ video-123.aspx

I have two updatepanel and a progressbar on the page. If I set the AssociatedUpdatePanelID, then progressbar is not working, without setting AssociatedUpdatePanelID progress bar is working but the problem is working for both updatepanel. But I need to work on one updatepanel.

 <asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" />
    <asp:Button ID="Button2" runat="server" Text="Button2" OnClick="Button2_Click" />
    <asp:UpdateProgress runat="server" ID="prg" AssociatedUpdatePanelID="upnl">
        <ProgressTemplate>
            <img src="Images/progressbar.gif" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    <asp:UpdatePanel runat="server" ID="upnl" UpdateMode="Conditional">
        <ContentTemplate>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="upnl1" UpdateMode="Conditional">
        <ContentTemplate>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>

Code Behind - C#

protected void Button1_Click(object sender, EventArgs e)
{
    System.Threading.Thread.Sleep(3000);
}
protected void Button2_Click(object sender, EventArgs e)
{
    System.Threading.Thread.Sleep(3000);
}

In this video, he also not set AssociatedUpdatePanelID
http://www.asp.net/learn/ajax-videos/video-123.aspx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瘫痪情歌 2024-08-05 03:37:03

优秀文章:以非常简单的方式解释每件事......................
http://www.codedigest.com/Articles/ASPNETAJAX/125_Using_UpdateProgress_Control_Effectively.aspx

根据设计,UpdatePanel 的外部触发器不会触发关联的 UpdateProgress,因为启用 UpdateProgress 控件的实现会在控件层次结构中搜索调用控件; 外部触发器不会出现在控制层次结构中。

Excellant Article: Explaining every thing in very simple manner..........
http://www.codedigest.com/Articles/ASPNETAJAX/125_Using_UpdateProgress_Control_Effectively.aspx

By Design External triggers for an UpdatePanel do not fire an associated UpdateProgress, since the implementation of enabling the UpdateProgress control searches the control hierarchy for the calling control; an external trigger will not be present in the control hierarchy.

眼波传意 2024-08-05 03:37:03

如果触发 UpdatePanel 的事件也是外部的,则 UpdateProgress 控件中的 AssociatedUpdatePanelID 属性将不起作用。

AssociatedUpdatePanelID property in the UpdateProgress control will not work if the event that triggered the UpdatePanel is also external.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文