简体   繁体   中英

Progress bar in web application using C# and asp.net

I need to have 2 progress bars in my application:

  1. Circular graphical progress bar ( busy indicator)
    • as shown in the link [15.1.3] when the page does a postback and
  2. A determinate progress bar
    • as shown in the link [15.1.1] with showing a percentage when I update or load data into the grid which I use in my application.

Can anyone help me with code snippets and how I can proceed with my .aspx and .aspx.cs files in order to obtain these progress bars for my application?

You can use an UpdateProgress control for the busy indicator, which is very easy:

   <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
       <ProgressTemplate>
           <div>
               <img src="../Resources/Images/indicator.gif" />
               Loading...
           </div>
       </ProgressTemplate>
   </asp:UpdateProgress>

But a progress bar is going to require a bit more work. You'll need to run a background thread to do the work, and you'll then need to periodically post back to check the value of, say, session variable to get your current progress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM