I have declared an object like this:
dim oTest
oTest = CreateObject("Scripting.Dictionary")
oTest.Add ("a", "Red")
oTest.Add ("b", "Blue")
and I want to pass this information to another page like this:
response.redirect ("nextpage.aspx?username=fred¶mstring=" & oTest)
but I'm getting this error:
Operator '&' is not defined for string "nextpage.aspx?username=fred" and type 'Dictionary'.
Can anyone help?
oTestcannot be pass directly toStringvariables, VBScript / Classic ASP doesn't support serialising objects you have to do that yourself using the various functions / methods available to you in VBScript.nextpage.aspxandaspxis an asp.net extension. 2- in VBScript your code cannot not compile due to errorMicrosoft VBScript compilation error: Cannot use parentheses when calling a Subby addressingoTest.Add (lines. 3-oTest = CreateObject("..is not a valid object assignment inVBScript, it should beSet oTest = CreateObject("... More evidence? And yes, you can store the object in Session, it works for both ASP Classic and ASP.Net.