views:

53

answers:

1

I'm new to web programming, right now, I'm working on on a Web Based Survey Application on which I want to utilize XML.

My Questions are the following:

  1. Using ASP.NET MVC, how do I return an XML File from the database to the Client?
  2. Usually, where does an XML file reside on the Client's directory and how to I locate it using JQuery or JavaScript?

Thanks

A: 

A google search lead me to this article which describes the process of sending an XML file (or any file stored in the database) to the client system near the end.

http://www.4guysfromrolla.com/articles/120606-1.aspx

When you send an XML file (or any other file sent via the method above) to a client, the user will be prompted and have save it to their hard drive. Once this has occurred, JavaScript will not have access to the file.

In my PHP experience, when you want to give JavaScript data to work with, you output it to a variable declaration somewhere in the script space such that you know where to retrieve and manipulate it. This may be more useful for whatever you're trying to accomplish but it rarely involves XML.

The grander question is what are you trying to do? It sounds like you need to rethink your approach. Just because you have a hammer doesn't mean everything is a nail.

antik
Hi, thanks for the advice and sharing your idea. It really enlightened me up. :)
moist
Glad it helped. Feel free to up vote my response if you liked it or accept it if it resolved your question.
antik