how handle QueryString object

  • Thread starter Ing. Branislav Gerzo
  • Start date
I

Ing. Branislav Gerzo

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.
 
J

Jeff Cochran

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
 
I

Ing. Branislav Gerzo

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.
 
A

Adrienne

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top