how handle QueryString object

Discussion in 'ASP General' started by Ing. Branislav Gerzo, Jun 29, 2005.

  1. Hello all,

    user have in browser address bar this URL:
    http://localhost/store/CDfilter.asp...esc&orderby=release_date&PerPage=50&PageNum=2

    I have on page filter form, and also users should change the order. In
    this case it is ordered by release_date desc, but how best handle and
    change this url ?

    When I print this page to user, I want have on link "sort by release"
    have this url:
    http://localhost/store/CDfilter.asp...asc&orderby=release_date&PerPage=50&PageNum=2

    on "Category" sort by catid and so on.

    I'm looking for function Set.QueryString or so.

    Now I am doing it - I first parse all arguments, and I'm making the
    "new URL" but I don't think it is the best method.

    Thanks for any help.
     
    Ing. Branislav Gerzo, Jun 29, 2005
    #1
    1. Advertising

  2. Ing. Branislav Gerzo

    Jeff Cochran Guest

    On Wed, 29 Jun 2005 08:58:48 +0200, "Ing. Branislav Gerzo"
    <> wrote:

    >user have in browser address bar this URL:
    >http://localhost/store/CDfilter.asp...esc&orderby=release_date&PerPage=50&PageNum=2
    >
    >I have on page filter form, and also users should change the order. In
    >this case it is ordered by release_date desc, but how best handle and
    >change this url ?
    >
    >When I print this page to user, I want have on link "sort by release"
    >have this url:
    >http://localhost/store/CDfilter.asp...asc&orderby=release_date&PerPage=50&PageNum=2
    >
    >on "Category" sort by catid and so on.
    >
    >I'm looking for function Set.QueryString or so.
    >
    >Now I am doing it - I first parse all arguments, and I'm making the
    >"new URL" but I don't think it is the best method.


    Are you asking how to best change a query string and resubmit to a new
    page, which will create a new query? Or are you asking the best way
    for the user to resort a set of records by the fields in the record?

    Jeff
     
    Jeff Cochran, Jun 29, 2005
    #2
    1. Advertising

  3. Jeff Cochran [JC], on Wednesday, June 29, 2005 at 11:09 (GMT) typed
    the following:

    JC> Are you asking how to best change a query string and resubmit to a new
    JC> page, which will create a new query?

    this one, sorry for my english.

    --

    How do you protect mail on web? I use http://www.2pu.net

    [Real Men Don't Need Instructions]
     
    Ing. Branislav Gerzo, Jun 29, 2005
    #3
  4. Ing. Branislav Gerzo

    Adrienne Guest

    Gazing into my crystal ball I observed "Ing. Branislav Gerzo"
    <> writing in
    news::

    > Jeff Cochran [JC], on Wednesday, June 29, 2005 at 11:09 (GMT) typed
    > the following:
    >
    > JC> Are you asking how to best change a query string and resubmit to a
    > new JC> page, which will create a new query?
    >
    > this one, sorry for my english.
    >


    http://localhost/store/CDfilter.asp?catid=3&lngid=3&osid=7
    &ordertype=desc&orderby=release_date&PerPage=50&PageNum=2

    If I were you, I would try to use numerical values for the ordertype and
    orderby values, just as the catid, lngid, and osid are. Then build your
    sql statement accordingly, eg:

    <% select case request.querystring("orderby")
    case "1"
    sort = " ORDER BY release_date "
    case "2"
    sort = " ORDER BY ordertype"
    case else
    sort = " ORDER BY id"
    end select

    sql = " SELECT values FROM table WHERE clause " & sort
    '...
    %>

    <table summary="CD Filter">
    <caption>CD Filter</caption>
    <thead>
    <th><a href="cdfilter.asp?catid=<%=catid%>&amp;lngid=<%=lngid%>&amp;osid=
    <%=osid%>&amp;ordertype=<%=ordertype%>&amp;orderby=1&amp;perpage=<%
    =perpage%>&amp;pagenum=<%=pagenum%>">Release Date</a></th>
    ....
    </thead>
    <tbody>
    <% 'records %>
    </tbody>
    </table>

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Jun 29, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    670
    Joe Smith
    Jul 22, 2004
  2. Mehdi
    Replies:
    6
    Views:
    36,261
    sloan
    Apr 6, 2006
  3. David C

    Handle # sign in url/querystring

    David C, Apr 7, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    446
    Cowboy \(Gregory A. Beamer\)
    Apr 7, 2008
  4. Samuel Fung

    Does Request.QueryString handle UTF-8 data?

    Samuel Fung, May 20, 2004, in forum: ASP General
    Replies:
    0
    Views:
    457
    Samuel Fung
    May 20, 2004
  5. Adeel Ahmad
    Replies:
    1
    Views:
    586
    Anthony Jones
    Mar 7, 2006
Loading...

Share This Page