|
-
Jul 12th, 2000, 06:29 AM
#1
Thread Starter
Fanatic Member
Hi Guys and Gals
I Have an ASP page that takes about 20 different values from a Query string. I grab them all into one container as follows
Dim Params
Set Params = Request.Querystring
I Then store the object in the session using
session("Ihatethissession") = Params
The problem is that when I use another page and try to retrieve this Object I can't get to the values.
Iv'e tried the following with no success
Dim Getparams
Set Params = session("Ihatethissession")
or
Dim Getparams
Set Params = Request.Querystring
Params = session("Ihatethissession")
When I try to retrieve a value using params("myvalue")
It keeps on saying a type missmatch
If any one can help
Most appreciated
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 12th, 2000, 09:18 AM
#2
Frenzied Member
Ian
It looks a though the QueryString is treated as a normal string once it has been put in a session variable
I expect you've beat me to it but I've just knocked up a function to return the required section of a string
Code:
function getRequest(Qstring,section)
dim strTemp
dim i
i = instr(Qstring,section)
if i > 0 then
strTemp = Mid(Params,i + len(section)+1 )
i = instr(strTemp,"&")
if i > 0 then
strTemp = left(strTemp,i-1)
end if
end if
getRequest = strTemp
end function
-
Jul 12th, 2000, 09:31 AM
#3
Thread Starter
Fanatic Member
Cheers Mark
I didn't even think about the easy option that it got turned into normal string again.
Once again thanks.
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 12th, 2000, 10:24 AM
#4
Thread Starter
Fanatic Member
Hi again Mark
Just for information, I did use your code because I couldn't be bothered to write it myself. If you need to use it for yourself, I would change this :
i = instr(Qstring,section)
if i > 0 then
strTemp = Mid(Params,i + len(section)+1 )
to
i = instr(Qstring, "&" & section & "=")
if i > 0 then
strTemp = Mid(Qstring,i + len(section) + 2)
It removes any errors when there are lots of variables that are simular
Cheers
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 12th, 2000, 01:59 PM
#5
Frenzied Member
That's a good point Ian
Also I rather embarisingly left "Params" in the code which I was using before I split it off into a function!
-
Jul 12th, 2000, 04:26 PM
#6
Thread Starter
Fanatic Member
No worries
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|