Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Reading an Xml file

Reading an Xml file

Scheduled Pinned Locked Moved XML / XSL
csharpasp-netsysadminxmlhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honeyss
    wrote on last edited by
    #1

    I had created an Xml file using XmlTextwriter in webapplication. like this XmlTextWriter writer = new XmlTextWriter(Server.MapPath("applicant.xml"), Encoding.UTF8); writer.WriteStartDocument(); writer.WriteStartElement("Applicant"); and so on when i click a button ...........Now can i retrieve that xml file in browser when i click a button...........i do not want to bind to any of the asp.net controls. i would like to display that Xml file in browser............. Can anyone help me in this regard.........

    S L 2 Replies Last reply
    0
    • H honeyss

      I had created an Xml file using XmlTextwriter in webapplication. like this XmlTextWriter writer = new XmlTextWriter(Server.MapPath("applicant.xml"), Encoding.UTF8); writer.WriteStartDocument(); writer.WriteStartElement("Applicant"); and so on when i click a button ...........Now can i retrieve that xml file in browser when i click a button...........i do not want to bind to any of the asp.net controls. i would like to display that Xml file in browser............. Can anyone help me in this regard.........

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Simplest way I can think of is redirecting the response to the created XML file: Response.Redirect("applicant.xml");


      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

      www.troschuetz.de

      1 Reply Last reply
      0
      • H honeyss

        I had created an Xml file using XmlTextwriter in webapplication. like this XmlTextWriter writer = new XmlTextWriter(Server.MapPath("applicant.xml"), Encoding.UTF8); writer.WriteStartDocument(); writer.WriteStartElement("Applicant"); and so on when i click a button ...........Now can i retrieve that xml file in browser when i click a button...........i do not want to bind to any of the asp.net controls. i would like to display that Xml file in browser............. Can anyone help me in this regard.........

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        honeyss wrote:

        Now can i retrieve that xml file in browser when i click a button

        You do it all in a single request eliminating the writing to disk part. In the button handler event you create a memory rather than disk file XmlTextWriter and then set the Response Content-Type to XML and use Response.Write(...) to return the XML.

        led mike

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups