2

我有一个按钮单击事件,它执行冗长的功能并且需要时间。所以我想显示一个进度条。你能告诉我我该怎么做吗?

我对 .NET 很陌生 .. 任何帮助表示赞赏

提前致谢, 阿姆丽莎

4

1 回答 1

0

I think this example is basic enough:

<form id="form1" runat="server">
   <asp:ScriptManager ID="sm" 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="upd" onclick="updButton_Click" 
                   text="click to update" />
         </ContentTemplate>
   </asp:UpdatePanel>
</form>

In code behind updButton_Click takes a long time to update, during the period you will see Loading... on the page, you can change the text to a <img src="blabla" /> to make it more like a ProgressBar(such as a GIF moving-bar image)

于 2011-02-15T09:35:53.133 回答