Solved

Retrieving server generated XML with JQuery

Posted on 2009-06-30
2
443 Views
Last Modified: 2013-11-11
Hello Experts,

I am new to this concept so if there is a better way to accomplish the following please let me know.

Currently, I have an data.aspx page and in the Page Load I get data from a db and create a stringbuilder object (myXML) and pass that back to the calling page in an HTTP Response stream like so: Response.Write(myXML)

I would like to parse this XML from the calling page using JQuery, but I am having trouble getting this to work.  I've found some helpful documentation using JQuery to parse XML given and XML document.  However, I don't have a document.  I am sending the xml via the Response.Write method.

Any help is appreciated.  If there is a better way to send the XML string into the calling page, I'm open to that.  I just need to be able to call the XML string using JQuery.


protected void Page_Load(object sender, EventArgs e)
{
    //code that gets data from database
 
    //code that constructs xml with stringbuilderXml
 
    //Write object to an HTTP response stream
       Response.Write(stringbuilderXml)
}
}

Open in new window

0
Comment
Question by:soapygus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 500 total points
ID: 24751349
Hi soapygus,
>>..However, I don't have a document.  I am sending the xml via the Response.Write method.
Not sure how you tight all together using JQuery method at the moment based on the posted. But, you can read the XML as string instead of parse XML document instead.
Check this blog for further details:
http://www.simplyprofound.com/post/Parse-XML-with-jQuery.aspx
Note: The XML format maybe vary compared your live case.
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question