Click here to Skip to main content
13,298,175 members (79,757 online)
Click here to Skip to main content
Add your own
alternative version


17 bookmarked
Posted 16 Dec 2011

Use jQuery Progressbar To Display The Percentage Of User Info

, 26 Dec 2011
Rate this:
Please Sign up or sign in to vote.
This article explains the function and the use of Progressbar

The original:


Due to the limited time, synchronization cannot be guaranteed in more than one blog article, at the following address you can view up-to-date content, please understand:

Please download the sample code at the section JQueryElement Demo Download of Download JQueryElement, the directory is /progressbar/Default.aspx.

This article explains the function and the use of Progressbar , the catalog is as follows:

* Prepare
* Progress
* Appendix: The Percentage Of Information


Be sure that you have got the latest version of JQueryElement at the section JQueryElement.dll Download of Download JQueryElement

Use the following statements to reference namespace:

<%@ Register Assembly="zoyobar.shared.panzer.JQueryElement"


 TagPrefix="je" %>
<%@ Register Assembly="zoyobar.shared.panzer.JQueryElement"


 TagPrefix="je" %>

In addition to the namespace, you need to reference the jQueryUI scripts and styles, there is a custom theme for jQueryUI in the compressed file downloaded at the section JQueryElement.dll Download of Download JQueryElement, if you need more themes, you can get them at

<link type="text/css" rel="stylesheet"

 href="[style path]/jquery-ui-<version>.custom.css" />
<script type="text/javascript"

 src="[script path]/jquery-<version>.min.js"></script>
<script type="text/javascript"

 src="[script path]/jquery-ui-<version>.custom.min.js"></script>


Through the property Value to initialize the progress, Value should be between 0 and 100.

You can also use javascript on the client to set or get the progress, more information please refer to

<je:Progressbar ID="pb" runat="server" ScriptPackageID="package"

 CssClass="info-bar" IsVariable="true">

<script type="text/javascript">
 $(function () {
  var p = progressbar('option', 'value');
  p += 20;

  pb.progressbar('option', 'value', p);

In the above example, set the IsVariable property of Progressbar to true, it'll generate a javascript variable named pb. You can use pb to get and set the progress of progressbar.

Appendix: The Percentage Of Information

In this section, we use Progressbar to show the percentage of user information:

<je:Progressbar ID="pb" runat="server" ScriptPackageID="package" Value="20">


<je:ScriptPackage ID="package" runat="server" />

Here is a progress bar, its corresponding javascript will be generated in the ScriptPackage control which the ID is package.

After the page loads, it'll call the method init that generated by AjaxManager:

<je:AjaxManager ID="ajax" runat="server">
 <je:AjaxSetting ClientFunction="init" Url="userinfo1.ashx" Success="
   $('#prec').text(-:data.prec + '%');
   pb.progressbar('option', 'value', -:data.prec);

  <je:Parameter Name="c" Type="Expression" Value="'get'" />


<script type="text/javascript">
 $(function () {

The role of init method is to get user information from the userinfo1.ashx, and the information will be displayed on the page. For more AjaxManager information, please refer to Use AjaxManager To Generate javascript That Calls The Server-Side Method.

In the above code, -:data will be replaced by data or data.d based on different .NET version, more information, please refer to Return JSON In Different .NET Version.

Finally, we need a save button:

<je:Button ID="cmdSave" runat="server" ScriptPackageID="package"

 Label="You can always save">
 <ClickAsync Url="userinfo1.ashx" Success="
  $('#prec').text(-:data.prec + '%');
  pb.progressbar('option', 'value', -:data.prec);

  <je:Parameter Name="c" Type="Expression" Value="'save'" />
  <je:Parameter Name="realname" Type="Selector" Value="'#realname'" />
  <je:Parameter Name="nickname" Type="Selector" Value="'#nickname'" />
  <je:Parameter Name="email" Type="Selector" Value="'#email'" />
  <je:Parameter Name="sex" Type="Selector" Value="'#sex'" />
  <je:Parameter Name="birthday" Type="Selector" Value="'#birthday'" />

When you click on the button, user information on the pages will be passed to userinfo1.ashx, userinfo1.ashx will return the percentage of information.

In AjaxManager and the ClickAsync property of Button, we use the Parameter to increase the parameter, more information can refer to Through Parameter Object Add Ajax Request Parameter.

Revision History

Return JSON In Different .NET Version
Use AjaxManager To Generate javascript That Calls The Server-Side Method
Through Parameter Object Add Ajax Request Parameter


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

Generalmy vote of 4 Pin
Uday P.Singh30-Dec-11 6:46
memberUday P.Singh30-Dec-11 6:46 
GeneralMy vote of 5 Pin
Abinash Bishoyi27-Dec-11 2:32
memberAbinash Bishoyi27-Dec-11 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 26 Dec 2011
Article Copyright 2011 by zoyobar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid