Question
Can anyone suggest how a loading image can be displayed before the gridview is fully loaded?
This gridview should appear when the page loads. There should be a simple solution to detect when the gridview is loading / loading, so you can achieve a simple switch between the load image and the visibility of the grid.
Please do not suggest using any methods of Ajax toolkit if the desired code cannot be isolated and used autonomously. I found that the toolkit would be easy to implement, but bloated and slow in performance. I do not want to include any scripts, files or code in my release package that will not be used.
ASP.NET
<img src="~/Loading.gif"></img>
<asp:GridView ID="gv" runat="Server" AutoGenerateColumns="False" EnableModelValidation="False">
'content...
</asp:GridView>
Vb
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
CAPABILITIES
I am open to any suggestions, but I tried to implement the solution using jquery methods , but I need help to execute.
JAVASCRIPT
$(function() {
$.ajax({
type: "POST",
url: "Default.aspx/UpdateGV",
data: "{}",
contentType: "application/json",
dataType: "json",
success: function() {
}
});
});
Vb.net
Imports System.Web.Services
Public Partial Class _Default
Inherits System.Web.UI.Page
<WebMethod(EnableSession := False)> _
Public Shared Function UpdateGV() As String
Return
Me.Bindgv()
End Function
End Class
source
share