This works well:
http://aspsnippets.com/Articles/Paging-in-ASPNet-GridView-using-jQuery-AJAX.aspx
but how would I add dyamic sorting so if user were to click a column then sort by it in asc or desc. And if possible can a filter be passed to all columns in a Like in that stored procedure?
Thanks!
Rob
You can add a @SortDirection Parameter and do as follows
SELECT ROW_NUMBER() OVER ( ORDER BY CASE WHEN @SortDirection = 1 THEN [CreatedDate] END ASC ,CASE WHEN @SortDirection = 2 THEN [CreatedDate] END DESC ) RowNumber
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.