question about sorting field in gridview and ajax

  • Thread starter Thread starter CH.
  • Start date Start date
C

CH.

Hi,

i read a lot of ajax stuff and i was asking myself this:
when clicking on the fieldname in a gridview (sorting enabled), the whole
database is sorted according to that field.
Is the whole html- page refreshed when doing that or only the data in the
gridview, and in that last case, can we say ajax is used? If not, why is
ajax not implelented (by default) in the sorting /updating actions?

Thanks
Ch
 
You can enable this declaratively by setting
EnableSortingAndPagingCallbacks="true" in your GridView. You don't
even need AJAX to do this.
 
Thanks Mark, I did not know that. My preferred method of databinding
is using the declarative method.
 
Marc,

I did EnableSortingAndPagingCallbacks="true" in my GridView and in order to
test whether the whole page is refreshed or not, i added in the aspx file
those lines:
<script language="javascript" type="text/javascript">
da= new Date()
trm=dal.getMinutes()
trs=da.getSeconds()
document.write(trm + " " + trs)
</script>

When EnableSortingAndPagingCallbacks="true" then on both cases (sorting or
paging), the time remains the same.
When "false", in both cases the time is different.

May i conclude that EnableSortingAndPagingCallback="true" is working in both
cases (page is not refreshed)?
 
Back
Top