title: How to display a loading image until a gridview is fully loaded without Ajax Toolkit?
body: <p><strong>QUESTION</strong></p>
  
  <p>Can anyone suggest how a loading image  can be displayed until a gridview is fully loaded?</p>
  
  <p>This gridview is to be rendered on page load. There must be a simple solution to detect when gridview is loading/loaded so a simple toggle between load image and gridview visibility can be achieved.</p>
  
  <p><strong>Please do not suggest using any of the Ajax toolkit methods</strong> unless the desired code can be isolated and used standalone. I have found the toolkit to be easy on implementation but bloated and slow on performance. I do not wish to include any scripts, files or code in my release package that is not going to be used.</p>
  
  <p><strong>ASP.NET</strong></p>
  
  <pre><code>      &lt;img src="~/Loading.gif"&gt;&lt;/img&gt;
  
        &lt;asp:GridView ID="gv" runat="Server" AutoGenerateColumns="False" EnableModelValidation="False"&gt;
          'content...
        &lt;/asp:GridView&gt;
  </code></pre>
  
  <p><strong>VB</strong></p>
  
  <pre><code>  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      'connection info
  
      If Not IsPostBack Then
        Me.Bindgv()
      End If
    End Sub
  
  
    Private Sub Bindgv()
      'Load gridview
    End Sub
  </code></pre>
  
  <hr>
  
  <h1>POSSIBILITIES</h1>
  
  <p>I am open to any suggestions however I was attemting to implement a solution using <strong>jquery</strong> page methods but need assistance to follow through.</p>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>$(function() {
    $.ajax({
      type: "POST",
      url: "Default.aspx/UpdateGV",
      data: "{}",
      contentType: "application/json",
      dataType: "json",
      success: function() {
        // Run return method.
      }
    });
  });
  </code></pre>
  
  <p><strong>VB.NET</strong></p>
  
  <pre><code>Imports System.Web.Services
  
  Public Partial Class _Default
      Inherits System.Web.UI.Page
  
      &lt;WebMethod(EnableSession := False)&gt; _
      Public Shared Function UpdateGV() As String
           Return 
           Me.Bindgv()
      End Function
  End Class
  </code></pre>