How to Page and Sort together

Results 1 to 2 of 2

Thread: How to Page and Sort together

  1. #1
    Join Date
    Dec 1969

    Default How to Page and Sort together

    hi there!<BR><BR> I did&#039;nt had any problem paging the records from my database ( 5 records per page)... now I am trying to sort the paged records... I am trying it from past two days... but unable to crack it..... can anyone help me....<BR><BR> thanks

  2. #2
    Join Date
    Dec 1969

    Default Do you allow user to change...

    ...the sort? If so, what do you do about the positioning of the paging? Do you start over? I don&#039;t really think it makes much sense to do otherwise?<BR><BR>*****************<BR><BR>If all you are worried about is *remembering* the SORT, then the easiest way is to build the SQL Query *ONLY ON THE FIRST PAGE* and then just use that query from then on.<BR><BR>You could store the SQL Query in a Session variable, for example, and only if the session variable is blank would you build the query. If it was non-blank, you would use it, as is!<BR><BR>[And, of course, if the user selects a different sort order, then you *force* the session variable to blank so that your query builder will build a new query and start over with the paging.]<BR><BR>Alternatively, you could carry the SQL Query along as a hidden form field, but to get started I really would recommend the Session variable as the easiest way.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts