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.Show Loading (Progress) GIF Image on ASP.Net ListView LinkButton Click using C# and VB.Net<p>Hi <a class="username" rel="nauna"> nauna</a>,</p> <p>Refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;style type=&#34;text/css&#34;&gt; .modal { position: fixed; top: 0; left: 0; background-color: black; z-index: 99; opacity: 0.8; filter: alpha(opacity=80); -moz-opacity: 0.8; min-height: 100%; width: 100%; } .loading { font-family: Arial; font-size: 10pt; border: 5px solid #67CFF5; width: 200px; height: 100px; display: none; position: fixed; background-color: White; z-index: 999; } &lt;/style&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;http://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 ShowProgress() { setTimeout(function () { var modal = $(&#39;&lt;div /&gt;&#39;); modal.addClass(&#34;modal&#34;); $(&#39;body&#39;).append(modal); var loading = $(&#34;.loading&#34;); loading.show(); var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0); var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0); loading.css({ top: top, left: left }); }, 50); } $(&#39;[id*=ListView2]&#39;).live(&#34;click&#34;, function () { ShowProgress(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;div&gt; &lt;asp:ListView ID=&#34;ListView2&#34; runat=&#34;server&#34; OnItemCommand=&#34;ListView2_ItemCommand&#34;&gt; &lt;ItemTemplate&gt; &lt;ul class=&#34;no-padding no-margin&#34;&gt; &lt;li&gt; &lt;asp:Label ID=&#34;Label2&#34; runat=&#34;server&#34; Text=&#39;&lt;%# Eval(&#34;time&#34;) %&gt;&#39;&gt;&lt;/asp:Label&gt;&lt;/li&gt; &lt;li&gt; &lt;asp:LinkButton ID=&#34;btn1&#34; runat=&#34;server&#34; Text=&#34;Click&#34; CommandName=&#34;selection1&#34;&gt; &lt;/asp:LinkButton&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; &lt;div class=&#34;loading&#34; align=&#34;center&#34; runat=&#34;server&#34; id=&#34;loadergif&#34;&gt; Loading. Please wait.&lt;br /&gt; &lt;br /&gt; &lt;img src=&#34;loader.gif&#34; alt=&#34;&#34; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><span style="text-decoration: underline;"><strong>Namespaces</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">using System.Data;</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Imports System.Data</pre> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { BindData(); } } private void BindData() { DataTable dt = new DataTable(); dt.Columns.Add(&#34;time&#34;); dt.Rows.Add(DateTime.Now); ListView2.DataSource = dt; ListView2.DataBind(); } protected void ListView2_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName == &#34;selection1&#34;) { System.Threading.Thread.Sleep(5000); string script = &#34;$(document).ready(function () { $(&#39;[id*=ListView2]&#39;).find(&#39;a&#39;).click(); });&#34;; ClientScript.RegisterStartupScript(this.GetType(), &#34;load&#34;, script, true); } }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)Handle Me.Load If Not Me.IsPostBack Then BindData() End If End Sub Private Sub BindData() Dim dt As DataTable = New DataTable() dt.Columns.Add(&#34;time&#34;) dt.Rows.Add(DateTime.Now) ListView2.DataSource = dt ListView2.DataBind() End Sub Protected Sub ListView2_ItemCommand(ByVal sender As Object, ByVal e As ListViewCommandEventArgs) If e.CommandName = &#34;selection1&#34; Then System.Threading.Thread.Sleep(5000) Dim script As String = &#34;$(document).ready(function () { $(&#39;[id*=ListView2]&#39;).find(&#39;a&#39;).click(); });&#34; ClientScript.RegisterStartupScript(Me.[GetType](), &#34;load&#34;, script, True) End If End Sub</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://i.imgur.com/bEhWy4x.gif" alt="" width="253" height="227" /></p>https://www.aspforums.net:443/Threads/137043/Show-Loading-Progress-GIF-Image-on-ASPNet-ListView-LinkButton-Click-using-C-and-VBNet/https://www.aspforums.net:443/Threads/137043/Show-Loading-Progress-GIF-Image-on-ASPNet-ListView-LinkButton-Click-using-C-and-VBNet/Mon, 19 Aug 2019 06:51:46 GMT