设置AssociatedUpdatePanelID当Updateprogessbar不工作? [英] Updateprogessbar is not working when Setting AssociatedUpdatePanelID?

查看:190
本文介绍了设置AssociatedUpdatePanelID当Updateprogessbar不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个的UpdatePanel和页面上的进度。如果我设置了AssociatedUpdatePanelID,那么进度不工作,没有设置AssociatedUpdatePanelID进度栏工作,但问题是要两个的UpdatePanel。但我需要工作在一个UpdatePanel的。

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的背后 - 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

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

推荐答案

Excellant文章:解释每一件事的非常简单的方式..........
<一href="http://www.$c$cdigest.com/Articles/ASPNETAJAX/125%5FUsing%5FUpdateProgress%5FControl%5FEffectively.aspx" rel="nofollow">http://www.$c$cdigest.com/Articles/ASPNETAJAX/125_Using_UpdateProgress_Control_Effectively.aspx

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

通过外部设计为一个UpdatePanel触发不火关联的UpdateProgress,因为使UpdateProgress控件执行搜索的呼叫控制控件层次结构;外部触发将不会被present的控制层次。

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.

这篇关于设置AssociatedUpdatePanelID当Updateprogessbar不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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