Free Online Articles Directory
17.11.2008 Sign In Register Hello Guest
Email:
Password:
Remember Me 
forgot your password?


Sorting Gridview Data With Ajax

Author: Ajax Tutorials Author Ranking Blue | Posted: 12-08-2008 | Comments: 0 | Views: 210 | Rating:  (102) Article Popularity - Blue (?) Got a Question? Ask.
Sign Up Now!

This tutorial was created with Visual Studio .NET 2008, but can still be recreated with 2005. Microsoft's ASP.NET AJAX Extensions for 2005 can be downloaded at this link.

In this tutorial, we will look at how we can use the GridView Control to display data Asynchronously, and how we can sort data in real-time, using AJAX. We will simply create a sample database, but you can use your own if you have one in mind, and we will add a button and a GridView to the ASPX page. Then we will display the data upon button click and allow sorting in real-time.

The first thing we will do is create the sample database. For this example, we will just use a table with names and cities, with some sample data. The next thing we will do is add the button, gridview and sqldatasource - then create the data source to our database:













ConnectionString=""
SelectCommand="SELECT * FROM [Table1]">



Notice that we have also associated the datasource with our gridview, set our gridview to allow sorting, and created a click event for our button. This click event will make the gridview visible, when clicked:





protected void butPopulate_Click(object sender, EventArgs e)
{
GridView1.Visible = true;
}

At present, the functionality will work as intended, but the whole page will post back - creating a delay for the user. What we want to do is to AJAX-enabled this page. We will add a ScriptManager and an UpdatePanel, so our ASPX page will now look something like this:


















ConnectionString=""
SelectCommand="SELECT * FROM [Table1]">





Our entire code-behind looks like this:

Please follow the link to ajaxtutorials.com to continue with the tutorial and code. Happy coding!

Rate this Article: Current: 0 / 5 stars - 0 vote(s).

Article Tags: Sorting, Ajax, Gridview Data

Article Source: http://www.articlesbase.com/programming-articles/sorting-gridview-data-with-ajax-519002.html

Print this Article Print article   Email to a Friend Send to friend   Publish this Article on your Website Publish this Article   Send Author Feedback Author feedback  
Ajax TutorialsAbout the Author:
Submitting articles has become one of the most popular means to drive traffic to your website and promote yourself and your business. Join us today - It's Free!

Article Comments

Comment on this article Comment on this article
Your Name
Your Email:
Comment Body
Enter Validation Code: Captcha


Related Articles


By: | 31/12/1969 |

Rich Internet Applications (ria)
By: Max J. Pucher | 22/03/2008 | Information Technology
The all-new hype is Rich Internet Applications (RIA). Adobe is touting Flash FLEX functionality as the next big thing in RIA. Papyrus EYE makes the development of completely dynamic user frontends in the browser much easier than Flex.

Installing Ajax Toolkit for Visual Studio .net 2005
By: Programminghelp.com | 08/08/2008 | Programming
In this article I will explain how you can integrate the AJAX framework into a web site and very easily create an AJAX enabled web site within Visual Studio 2005 utilizing C#.

The Web 2.0 Effect: the Characteristics of a Web2.0 Website
By: M.Markell | 05/02/2007 | Networks
The term web2.0 was originally presented by O'Reilly Media (A well known media company publishing books and websites on various computer technology topics). It's a term that refers to a new generation of websites (social networking websites, wiki-based websites etc). These websites take advantage of web application technologies and give web users the ability to collaborate and share their experiences, views, opinions and interests while they surf the web.

Finding a Website for Hot Source of CSS Information?
By: Walloon Brabant | 09/04/2008 | SEO
For web developers, getting a web development platform that would be catering a new web experience is their dream. Before, websites are designed in an old fashion way of text, images and plug-ins. As the internet experience evolved, it becomes more complicated that the usual HTML program could not cater it anymore. While plug-ins like Flash objects have redefined the web experience, nevertheless, has also its own downfall and that is readability.

Creating a Simple Ajax Control in Asp.net 2.0 and C#
By: Programminghelp.com | 08/08/2008 | Programming
In this article I will explain how you can easily create an AJAX enabled web site within Visual Studio 2005 utilizing C# and how to utilize the AJAX framework to add a simple control from the list of controls available in the AJAX Control Toolkit.

What is the Ajax Enabled Google Tool-kit?
By: Munish Dev Rathee | 22/02/2007 | Internet
Here is how these individual technologies play a role in AJAX: • XHTML (or HTML) and CSS are used for mark up and styling information. • The DOM (Document Object Model) is employed for the actual interaction that happens with the information that is presented. • The exchange of data asynchronously with the web server happens with the use of XMLHttpRequest. Although there are many cases where an IFrame object is used in its place. • Even though even preformatted HTML would work, XML is the forma

Your One Stop for CSS Information
By: Walloon Brabant | 09/04/2008 | SEO
CSS has become a new platform in developing website nowadays. The novelty of CSS has redefined the limits of the webpage viewing experience. Once can see some websites at relatively easier way and at the same time fashionably tailor fit that would totally make it irresistibly chic.

Got a Question? Ask.

Ask the community a question about this article:

Frequently Asked Questions

How to post a letter on the internet
By: Mike | 20-10-2008
how to post a letter on the internet

Does anyone know what is ubzpath.com is about?
By: ChandraC850 | 18-10-2008
Does anyone know what is ubzpath.com is about?

Domain Name List
By: Joe | 11-10-2008
Is there any way to get a list of used Domain Names?  I got a friend's e-mail address, but I must have copied down the wrong Domain name.

List of valid Domain names
By: Joe | 10-10-2008
Is there any place where I can get a list of Domain names in use. I got a friends e-mail address, but it looks like I didn't copy the right domain name.

Music video
By: MD | 06-10-2008
How to download free hqmusic videos

Is there any Free online soccer Management games ...
By: sissco | 05-10-2008
Is there any Free online soccer Management games on the internet that I can join ithout having to download anything?

Q&A Powered by:
Powered by Yedda 

Latest Programming Articles

Tips for Buying Software Online
By: Daniel Jowssey | 17/11/2008
Buying software online not only helps save the planet, it also has other benefits, including: * Ease and Simplicity. You can purchase software in your underwear at 4am if you really want to. Shopping online doesn’t have to be done within regular business hours, nor do you need to look your best to do it. It’s also easy to shop around for the best prices and takes less time than driving to the shops.

Mvc Design Pattern
By: TuVinhSoft .,JSC | 14/11/2008
Model-view-controller (MVC) is an architectural pattern used in software engineering. In complex computer applications that present a large amount of data to the user, a developer often wishes to separate data (model) and user interface (View) concerns, so that changes to the user interface will not affect data handling, and that the data can be reorganized without changing the user interface.

Advantages of Low Cost Contract Programmers in Freelance Programming
By: Joanna Gadel | 12/11/2008
It observed that web industry is getting tougher thus the necessity of freelance contract programmer is required for developing more effective website with flexible features. This article states the fruitful advantages of freelance programmers in contract programming.

A Guide to Cnc Kits
By: Martin Applebaum | 09/11/2008
CNC kits are a way in which to construct your CNC machine. This article will provide some information on these machines.

A Guide to Cnc Tube Bending Machines
By: Martin Applebaum | 08/11/2008
Are you familiar with a CNC tube bending machine? This article will shed some light on the main function and components of this machine.

Ways to Hire Dedicated Php Programmers
By: Jucick | 08/11/2008
It’s not at all easy to hire dedicated PHP programmers unless you know where and how to find them. Whether you need to fix, update or enhance your website you naturally want the job done quick and right.

Top 4 Reasons Why Addressing Web Accessibility is Important
By: Matt Cave | 05/11/2008
There are very high chances that web accessibility is more important to the performance of your web site than you realize. Article takes a look at the top 4 reasons why it would be important to address the issue of web accessibility.

Xlphoto Printing, the Best Choice for Banner Printing and Poster Printing
By: Vikram Kumar | 01/11/2008
Suppose, you have visited a tourist spot or a hill station; over there, you have witnessed some of the mesmerizing locations of serene nature.

More from Ajax Tutorials

Nesting Updatepanels in Asp.net 3.5
By: Ajax Tutorials | 12/08/2008 | Programming
In this tutorial, we will look at how we can nest UpdatePanels. You can nest as many UpdatePanels as you want- there is no limit. In this example, we will be creating two UpdatePanels and nesting one in the other. One will display a person from a database, that is selected from a DropDownMenu, the nested UpdatePanel will display the current time, so we can see when it is updated.

Article Categories





Give Feedback

Sign up for our email newsletter

Receive updates, enter your email below