Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: trying to maintain the URL parameters


Message #1 by "Oliver Dempsey" <odempsey@b...> on Wed, 25 Apr 2001 00:08:13 +0100
Hi there



This piece of code works nice copying the URL parameters until you have 

multiples values for one item, in my case 

checkbox=3DDetached&checkbox=3DTerrace etc.

here is the code:-



' add the URL parameters to the MM_keepURL string

For Each Item In Request.QueryString

  NextItem =3D "&" & Item & "=3D"

  If (InStr(1,MM_removeList,NextItem,1) =3D 0) Then

    MM_keepURL =3D MM_keepURL & NextItem & 

Server.URLencode(Request.QueryString(Item))

  End If

Next



As you can see it changes this URL :-

Results.asp?TownID=3DAllTowns&checkbox=3DBungalow&checkbox=3DSemi-Detache

d&MinPrice=3D0&MaxPrice=3D10000000&checkbox=3DDetached&checkbox=3DTerrace

&MinBeds=3D0&MaxBeds=3D100&Submit=3DSubmit



into this URL :-

Results.asp?TownID=3DAllTowns&Submit=3DSubmit&checkbox=3DBungalow%2C+Semi

%2DDetached%2C+Detached%2C+Terrace&MinPrice=3D0&MaxPrice=3D10000000&MinBe

ds=3D0&MaxBeds=3D100



I had been handling the items in checkbox using the following code:-

If Request.QueryString("checkbox").count > 0 then

strSQL=3D strSQL & " and ("

  for intcount =3D 1 to Request.QueryString("checkbox").count

  strSQL =3D strSQL & " PropertyType =3D " & "'" & 

Request.QueryString("checkbox")(intcount) & "' or"

  Next

strSQL =3D Left(strSQL, Len(strSQL) - 2)

strSQL =3DstrSQL &") "

 End if



But now it doesn't recognise the contents of checkbox because it seems 

to have been changed into a string instead of an array (am I right?)

Is there any handy way of maintaining the checkbox URL parameters as 

they were or would I need to retrieve them another way?



 Kind Regards

Oliver Dempsey



Message #2 by "Oliver Dempsey" <odempsey@b...> on Wed, 25 Apr 2001 16:37:11 +0100
Can anybody help me with this problem?



Oliver







----- Original Message -----

From: Oliver Dempsey <odempsey@b...>

To: ASP Web HowTo <asp_web_howto@p...>

Sent: Wednesday, April 25, 2001 12:08 AM

Subject: [asp_web_howto] trying to maintain the URL parameters





Hi there



This piece of code works nice copying the URL parameters until you have

multiples values for one item, in my case checkbox=Detached&checkbox=Terrace

etc.

here is the code:-



' add the URL parameters to the MM_keepURL string

For Each Item In Request.QueryString

  NextItem = "&" & Item & "="

  If (InStr(1,MM_removeList,NextItem,1) = 0) Then

    MM_keepURL = MM_keepURL & NextItem &

Server.URLencode(Request.QueryString(Item))

  End If

Next



As you can see it changes this URL :-

Results.asp?TownID=AllTowns&checkbox=Bungalow&checkbox=Semi-Detached&MinPric

e=0&MaxPrice=10000000&checkbox=Detached&checkbox=Terrace&MinBeds=0&MaxBeds=1

00&Submit=Submit



into this URL :-

Results.asp?TownID=AllTowns&Submit=Submit&checkbox=Bungalow%2C+Semi%2DDetach

ed%2C+Detached%2C+Terrace&MinPrice=0&MaxPrice=10000000&MinBeds=0&MaxBeds=100



I had been handling the items in checkbox using the following code:-

If Request.QueryString("checkbox").count > 0 then

strSQL= strSQL & " and ("

  for intcount = 1 to Request.QueryString("checkbox").count

  strSQL = strSQL & " PropertyType = " & "'" &

Request.QueryString("checkbox")(intcount) & "' or"

  Next

strSQL = Left(strSQL, Len(strSQL) - 2)

strSQL =strSQL &") "

 End if



But now it doesn't recognise the contents of checkbox because it seems to

have been changed into a string instead of an array (am I right?)

Is there any handy way of maintaining the checkbox URL parameters as they

were or would I need to retrieve them another way?



 Kind Regards

Oliver Dempsey




  Return to Index