Hi I dont know what string to put this in but Im working on this web application a total rewrite of an classical ASP site into the world of ASP.NET 2.0 and now im going to send some information to a secure server as below: and I get the error Object variable or With block variable not set. Dim objHTTP As Object
objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open("GET", "https://securewebsite.com, False)
'Sending request
objHTTP.Send()
Dim strHTML = objHTTP.responseText
objHTTP = Nothing
'Check for error in communication
If Err.Number = 0 Then
'If no error, then send customer to TellusPay secure serverResponse.Redirect("https://securewebsite.com/WebOrder/?" & Trim(strHTML))
Else
'Else print "General Error"Response.Write("General Error!<br>" & Err.Description)
End If
I believe its connected to the beginning of the code here with Dim objHTTP as object they say in some articles Im not supposed to do that and in some places they write that I need to set the object like this
SET objHTTP = new Server.CreateObject("Microsoft.XMLHTTP")
But then Visual studio removes the SET statement and it states that SET is no longer supported so how should I rewrite this code to get it working in ASP.NET 2.0.
any Suggestions on how I should do this?
Thanks in advance
Magnus