The next step is to bind the GridView control to the
SqlDataSource control and display the records from the Contacts table into the
GridView. Simply drag and drop the GridView control and assign the
DataSourceID property to the SqlDataSource1. You can also enable the paging,
selection and sorting by clicking on the checkboxes that appear when you view
the “Smart Tag.” When you run the application you will see that the GridView
is getting populated, as shown in the image below.
Figure 3
Although everything seems to be working, if you look carefully
you will find that each time you make a selection or sort the GridView it will
fire a postback which causes the page to reload. Let us see how to remove this
postback.