List results in alphabetical order ?

Results 1 to 2 of 2

Thread: List results in alphabetical order ?

  1. #1
    Join Date
    Dec 1969

    Default List results in alphabetical order ?

    I am developing an application contains Category, name, City (yellow pages).... <BR><BR>IN the top all categories are listed as Radio button. Down i want to display <BR>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z. When the visitor clicks any alphabet i want to display all the data in Cities starting with those alphabet. <BR><BR>is there any control available ? or could anyone give logic how i can write these ? <BR><BR>what i did ? <BR><BR>Problem is i want to display records when they click the categories. (all cities). when they click alphabets i want to display records ONLY those cities. (so two events). Listing by alphabet is optional. <BR><BR>i tried with linkbutton onclick event, but i don&#039;t know how to pass &#039;A&#039; or &#039;B&#039; ... to function or subroutine from link button command. i am going for event because i need to get Categories in Request.Params command. <BR><BR>Please help.

  2. #2
    Join Date
    Dec 1969

    Default Querystrings ?????

    I had some thing like this a while ago and the code below got me through nicely. If you do a link like next_page.asp?letter=a and then use a variation of the below code. Don&#039;t forget the % so that you find all cities starting with that letter.<BR><BR>If the page has a querystring then it will find all records starting with that letter. Hope this helps.<BR><BR>&#039;Initialise the strSQL variable with an SQL statement to query the database <BR>strSQL = "SELECT * FROM Cities"<BR>strorder = querystring("letter")<BR><BR>if strorder &#060;&#062; "" then<BR><BR>if sortby &#060;&#062; "" then<BR> strSQL = strSQL & " WHERE [whatever the field name is] =" & strOrder " <BR><BR>else <BR><BR>end if<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