views:

14

answers:

0

I can't do anything with the response text from the below code other than print it to the screen. I want to use an if statement to check what the response text is,but whenever I try this it prints nothing.

For the sake of this example, assume the response text is "2"

Code:

Set xmlhttp = server.CreateObject("MSXML2.XMLHTTP")
xmlhttp.open "POST", url,false
xmlhttp.setRequestHeader "Content-Type", "text/xml"
message = "test example"
xmlhttp.send(message)

if xmlhttp.responseText = "2"
response.Write("Found a 2")
end if

What's happening is if I just have response.Write(xmlhttp.responseText) it will print out the two, but when I try and do any string functions on the response text it ignores it and prints nothing

Any help appreciated