Progressbar Template Shows Up When It's Not Needed

夙愿已清 提交于 2019-12-25 05:09:45

问题


I have an updatepanel that includes a textbox, a search button and a gridview. the gridview has some bound fields (first name and last name) and 1 templated field (a button).

The user inserts a name into the textbox, click the button named "search" and the gridview is filled with names and buttons (Each button adds a value to a list box).

There is also a progressbar which associated with that updatePanel and it shows a "loading" div when I click the "search" button.

<asp:UpdateProgress ID="UpdateProgress1" runat="server" 
        AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
    <ProgressTemplate>
      <div>Loading...</div>
    </ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel Id="UpdatePanel1" UpdateMode="Conditional" 
     ChildrenAsTriggers="False" runat="server">
   <Triggers>
      <asp:AsyncPostBackTrigger ControlID="SearchButton" EventName="Click" />
   </Triggers>
   <ContentTemplate>
       <asp:GridView>
          ...
       </asp:GridView>
   </ContentTemplate>
</asp:UpdatePanel>

And here is the problem - every time I click the buttons in the templated field, the loading div shows up too. These buttons don't cause partial postback, so why does the loading div show up?

Thanks!

来源:https://stackoverflow.com/questions/9042359/progressbar-template-shows-up-when-its-not-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!