I am making an xmlhttp request (using the scripts provided inAjax for Web Application Developersby Kris Hadlock) to get data from an aspx page. When I create a dataset and return xml with an xmldocument it works fine. I am using the following where dsreturn is the getXML of the dataset.
Dim xdocAs XmlDocument =New XmlDocument()xdoc.LoadXml(dsreturn)
xdoc.Save(Response.OutputStream)
The problem is that I also want to return json. I have created a biz class to parse a dataset and return a json string. I know this works because I have used it in other web services. When I do this I get nothing. I think that my problem is how to return the json string in the response.outputstream. I am not sure how to do this. Just using response.write doesnt seem to work.
Thanx
Have you considered using page methods instead of doing it all by hand? They return JSON by default.
No comments:
Post a Comment