ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Display ListView Scroll percentage in ProgressBar using jQuery in ASP.Net<p>Hi <a class="username" rel="nauna"> nauna</a>,</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">Database</span></strong></p> <p>For this example I have used of Northwind database that you can download using the link given below.</p> <p><a href="https://www.aspsnippets.com/Articles/Install-Microsoft-Northwind-and-Pubs-Sample-databases-in-SQL-Server-Management-Studio.aspx">Download Northwind Database</a></p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;div id=&#34;dvProgress&#34; style=&#34;height: 15px; background-color: Red; width: 0px; text-align: center;&#34;&gt; &lt;/div&gt; &lt;br /&gt; &lt;div id=&#34;dvPanel&#34; style=&#34;overflow-y: scroll; height: 200px; width: 600px;&#34;&gt; &lt;asp:ListView ID=&#34;lvCustomers&#34; runat=&#34;server&#34; GroupPlaceholderID=&#34;groupPlaceHolder1&#34; ItemPlaceholderID=&#34;itemPlaceHolder1&#34;&gt; &lt;LayoutTemplate&gt; &lt;table id=&#34;ListViewTable&#34;&gt; &lt;tr&gt; &lt;th&gt; Id &lt;/th&gt; &lt;th&gt; Name &lt;/th&gt; &lt;th&gt; Country &lt;/th&gt; &lt;th&gt; &lt;/th&gt; &lt;/tr&gt; &lt;asp:PlaceHolder runat=&#34;server&#34; ID=&#34;groupPlaceHolder1&#34;&gt;&lt;/asp:PlaceHolder&gt; &lt;/table&gt; &lt;/LayoutTemplate&gt; &lt;GroupTemplate&gt; &lt;tr&gt; &lt;asp:PlaceHolder runat=&#34;server&#34; ID=&#34;itemPlaceHolder1&#34;&gt;&lt;/asp:PlaceHolder&gt; &lt;/tr&gt; &lt;/GroupTemplate&gt; &lt;ItemTemplate&gt; &lt;td&gt; &lt;%# Eval(&#34;CustomerId&#34;)%&gt; &lt;/td&gt; &lt;td&gt; &lt;%# Eval(&#34;ContactName&#34;)%&gt; &lt;/td&gt; &lt;td&gt; &lt;%# Eval(&#34;Country&#34;) %&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:TextBox runat=&#34;server&#34; ID=&#34;txtCity&#34; /&gt; &lt;asp:Button Text=&#34;View&#34; runat=&#34;server&#34; ID=&#34;btnView&#34; /&gt; &lt;/td&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $(&#39;[id*=dvPanel]&#39;).scroll(function () { var divScrollPosition = $(this).scrollTop(); var listViewTableHeight = $(&#39;[id*=ListViewTable]&#39;).height(); var divHeight = $(this).height(); var scrollPercentage = (divScrollPosition / (listViewTableHeight - divHeight)) * 100; $(&#39;[id*=dvProgress]&#39;).html(scrollPercentage.toFixed() + &#39;%&#39;); $(&#39;[id*=dvProgress]&#39;).css(&#39;width&#39;, scrollPercentage.toFixed() + &#34;%&#34;); }); }); &lt;/script&gt; &lt;/div&gt;</pre> <p><strong><span style="text-decoration: underline;">Namespace</span></strong></p> <pre class="brush: csharp">using System.Data; using System.Configuration; using System.Data.SqlClient;</pre> <p><strong><span style="text-decoration: underline;">Code</span></strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { lvCustomers.DataSource = GetData(); lvCustomers.DataBind(); } } private DataSet GetData() { string conString = ConfigurationManager.ConnectionStrings[&#34;constr&#34;].ConnectionString; string query = &#34;SELECT * FROM Customers&#34;; SqlCommand cmd = new SqlCommand(query); using (SqlConnection con = new SqlConnection(conString)) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (DataSet ds = new DataSet()) { sda.Fill(ds, &#34;Customers&#34;); return ds; } } } }</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><img src="https://imgur.com/me7yGaX.gif" alt="" width="472" height="237" /></p>https://www.aspforums.net:443/Threads/857287/Display-ListView-Scroll-percentage-in-ProgressBar-using-jQuery-in-ASPNet/https://www.aspforums.net:443/Threads/857287/Display-ListView-Scroll-percentage-in-ProgressBar-using-jQuery-in-ASPNet/Fri, 12 Oct 2018 03:01:48 GMT