RSS

How To Display A Loading Image When Gridview Data Loading Is In Progress

10 Jun

ClientSite

<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Loading.aspx.cs” Inherits=”Loading” %>

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

<head runat=”server”>

<title></title>

<link href=”style/ModelExtender.css” rel=”stylesheet” type=”text/css” />

</head>

<body  >

<form id=”form1″ runat=”server”>

<asp:ScriptManager ID=”ScriptManager1″ runat=”server”>

</asp:ScriptManager>

<div style=”margin-left:255px;margin-top:76px”>

<asp:UpdateProgress ID=”UpdateProgress2″ runat=”server” AssociatedUpdatePanelID=”UpdatePanel2″>

<ProgressTemplate>

<div id=”progressBackgroundFilter”></div>

<div id=”processMessage”></div>

</ProgressTemplate>

</asp:UpdateProgress>

<asp:UpdatePanel ID=”UpdatePanel2″ runat=”server” UpdateMode=”Conditional”>

<ContentTemplate>

<br />

<asp:Button ID=”btnLoad” runat=”server”

Text=”Load Grid” onclick=”btnLoad_Click” ForeColor=”Red” />

<br />  <br />

<asp:GridView ID=”GridView1″ runat=”server” CellPadding=”4″ ForeColor=”#333333″

GridLines=”None” AutoGenerateColumns=”false” AllowPaging=”True”

PageSize=”5″>

<AlternatingRowStyle BackColor=”White” />

<Columns>

<asp:BoundField DataField=”DocumentID” HeaderText=”DocumentID ” />

<asp:BoundField DataField=”Title” HeaderText=”Title  ” />

<asp:BoundField DataField=”displayTitle” HeaderText=”displayTitle ” />

<asp:BoundField DataField=”friendlyUrl” HeaderText=”friendlyUrl ” />

</Columns>

<EditRowStyle BackColor=”#2461BF” />

<FooterStyle BackColor=”#507CD1″ Font-Bold=”True” ForeColor=”White” />

<HeaderStyle BackColor=”#507CD1″ Font-Bold=”True” ForeColor=”White” />

<PagerStyle BackColor=”#2461BF” ForeColor=”White” HorizontalAlign=”Center” />

<RowStyle BackColor=”#EFF3FB” />

<SelectedRowStyle BackColor=”#D1DDF1″ Font-Bold=”True” ForeColor=”#333333″ />

<SortedAscendingCellStyle BackColor=”#F5F7FB” />

<SortedAscendingHeaderStyle BackColor=”#6D95E1″ />

<SortedDescendingCellStyle BackColor=”#E9EBEF” />

<SortedDescendingHeaderStyle BackColor=”#4870BE” />

</asp:GridView>

</ContentTemplate>

</asp:UpdatePanel>

</div>

</form>

</body>

</html>

ServerSide

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class Loading : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

//System.Threading.Thread.Sleep(5000);

}

}

public static DataSet Events_getAll(string qry)

{

sqlhelper data_manager = new sqlhelper();

Hashtable ht_params = null;

DataSet dt = null;

try

{

ht_params = new Hashtable();

dt = data_manager.SQLDataSet(qry);

return dt;

}

catch (Exception ex)

{

throw ex;

}

finally

{

ht_params = null;

data_manager = null;

}

}

private void BindGridViewView()

{

string qry = “select * from documents where  siteid=76”;

GridView1.DataSource = Events_getAll(qry);

GridView1.DataBind();

}

protected void btnLoad_Click(object sender, EventArgs e)

{

BindGridViewView();

}

}

Advertisements
 
1 Comment

Posted by on June 10, 2011 in Vb.Net

 

Tags: , , , , ,

One response to “How To Display A Loading Image When Gridview Data Loading Is In Progress

  1. Christhu

    July 24, 2014 at 12:45 pm

    Good. But how people can use your coding. where is css coding?

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: