Posted By

tabook22 on 07/11/11


Tagged

xml VBNet aspnet


Versions (?)

Create a new xml file and display it in browser


 / Published in: VB.NET
 

Create a new xml file and display it in browser

  1. Dim products As New XDocument(New XDeclaration("1.0", "utf-8", ""), _
  2. New XElement("products", _
  3. New XElement("product", _
  4. New XAttribute("id", "p1"), _
  5. New XElement("name", "Alpha"), _
  6. New XElement("price", "1200"), _
  7. New XElement("stock", "19"), _
  8. New XElement("country", "Germany"))))
  9. products.Save(Server.MapPath("products-linq.xml"))
  10.  
  11. Response.Redirect("products-linq.xml")
  12. 'load file in browser

Report this snippet  

You need to login to post a comment.