I have a method that performs an HTTPWebRequest and returns the
Response to my AJAX JS function.
Worked flawlessly using 6.5.5.1. But when I try to use 6.7.20.1, I get
a res.error of "Input String is not the Correct Format".
I am passing the URI and Querystring params in the initial Callback and
processing those through the VB method. It appears that these param
strings have changed somehow.
Did something change in how these strings are passed to the Server Side
methods?
NOTE: When I revert back to 6.5.5.1, everything is fine again.
VB excerpt:
<AjaxPro.AjaxMethod()> _
Public Function MagicSubmit(ByVal uri As String, ByVal pstdata
As String) As String
Dim context As HttpContext = HttpContext.Current
Dim request As HttpRequest = context.Request
Dim str As String
Dim siteURI As New Uri(uri)
Dim lcUrl As String = uri
Dim loHttp As HttpWebRequest =
CType(WebRequest.Create(lcUrl), HttpWebRequest)
loHttp.Timeout = 600000
If ((context.Request.QueryString("OUTSD")) <> "Y") Then
Dim cookieCols As New HttpCookieCollection
loHttp.CookieContainer = New CookieContainer()
cookieCols = request.Cookies
For Each str In cookieCols
Dim hCook = request.Cookies(str)
Dim cookie As Cookie = New Cookie(hCook.Name,
hCook.Value, hCook.Path)
loHttp.CookieContainer.Add(siteURI, cookie)
Next
End If
Dim lcPostData As String = pstdata
loHttp.Method = "POST"
Dim lbPostBuffer As Byte() =
System.Text.Encoding.GetEncoding(1252).GetBytes(lcPostData)
loHttp.ContentLength = lbPostBuffer.Length
Dim loPostData As Stream = loHttp.GetRequestStream()
loPostData.Write(lbPostBuffer, 0, lbPostBuffer.Length)
loPostData.Close()
Dim loWebResponse As HttpWebResponse =
CType(loHttp.GetResponse(), HttpWebResponse)
Dim enc As Encoding =
System.Text.Encoding.GetEncoding(1252)
Dim loResponseStream As StreamReader = New
StreamReader(loWebResponse.GetResponseStream(), enc)
Dim lcHtml As String = loResponseStream.ReadToEnd()
loWebResponse.Close()
loResponseStream.Close()
Return lcHtml
End Function
My Javascript:
function dotnetcallback(x){
x.value == null || x.error != null ? alert(x.error.Message + '\n' +
x.error.Name + '\n' + x.error.Description):
onDownloadDone(x.value.trim());
alert(x.value);
}
function CallNow(path, args)
AjaxPro.timeoutPeriod=600*1000;
MagicCall.Magictools.Submits.MagicSubmit(path, args ,
dotnetcallback);
}
I then pass:
path= http://mysite/myprg
args= PARAM1=Val1&PARAM2=Val2&Etc=Etc
The VB method builds the URI and the post data from these arguments and
performs the webrequest.
As I said, it has worked GREAT with 6.5.5.1.
Any ideas?
TIA,
Ken Krickbaum
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---