我的页面在不同的地方有多个更新进度,但它们都有一个更新面板的ID,因为我只使用一个更新面板我的问题是如何让更新进度来显示更新时的内容完了。
这是我的代码示例:
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Label ID="platformLabel" runat="server"
Text=" <%$Resources:Resource,SelectPlatform %>">
</asp:Label>
<asp:LinkButton ID="platformHyperLink" runat="server"
CssClass="platformElementHL"
CommandArgument='<%# Eval("PLATFORM_ID")%>'
OnClick="platformHyperLink_Click"
OnClientClick="ShowSearchButton();" />
<asp:Label ID="PlatformNameLabel" runat="server"
Text='<%# Eval("PLATFORM_NAME")%>' >
</asp:Label>
<telerik:RadButton ID="findDevice" runat="server"
Text="<%$Resources:Resource,Search %>"
OnClientClicked="HideTootltip"
OnClick="findDevice_Click"
style="display:none">
</telerik:RadButton>
<asp:UpdateProgress ID="updProgress1"
AssociatedUpdatePanelID="UpdatePanel" runat="server">
<ProgressTemplate>
<img src="App_Themes/WebPortalTheme/images/HomePage/icon-loading-
animated.gif" width="20" height="20" alt="Progress" />
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdateProgress ID="updProgress2"
AssociatedUpdatePanelID="UpdatePanel" runat="server">
<ProgressTemplate>
<img src="App_Themes/WebPortalTheme/images/HomePage/icon-loading-
animated.gif" width="20" height="20" alt="Progress" />
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
当我点击链接按钮时,应显示updateProgress1,当我点击radButton时,updateprogress2应显示任何想法?
答案 0 :(得分:2)
您必须使用两个updatepanel(一个用于linkbutton,另一个用于radiobutton)并将每个updateprogress与相应的相关联。如果您需要更新整个页面,请使用一个全局更新面板,方法是根据需要设置childastrigger选项。
<asp:UpdatePanel ID="UpdtGlobal" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text=" <%$Resources:Resource,SelectPlatform %>" />
<asp:UpdatePanel ID="UpdtLinkButton" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="platformElementHL" CommandArgument='<%# Eval("PLATFORM_ID")%>'
OnClick="platformHyperLink_Click" OnClientClick="ShowSearchButton();" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("PLATFORM_NAME")%>' />
<asp:UpdatePanel ID="UpdtRadButton" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<telerik:radbutton id="findDevice" runat="server" text="<%$Resources:Resource,Search %>"
onclientclicked="HideTootltip" onclick="findDevice_Click" style="display: none" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdtLinkButton"
runat="server">
<ProgressTemplate>
<img src="App_Themes/WebPortalTheme/images/HomePage/icon-loading-animated.gif" width="20"
height="20" alt="Progress" />
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdateProgress ID="UpdateProgress2" AssociatedUpdatePanelID="UpdtRadButton"
runat="server">
<ProgressTemplate>
<img src="App_Themes/WebPortalTheme/images/HomePage/icon-loading-animated.gif" width="20"
height="20" alt="Progress" />
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>