web 2.0

ASP.NET(vb.net) & Xml - asp:Xml

ASP.NET(vb.net) & Xml - asp:Xml - asp:Xml : Displays an XML document or the results of an XSL Transform.

ShotDev Focus:
- ASP.NET(vb.net) & Xml - asp:Xml

ASP.NET(vb.net) & Xml - asp:Xml

Tag Control :

  1. <asp:Xml id="Xml1"  
  2. Document="XmlDocument object to display"  
  3. DocumentContent="String of XML"  
  4. DocumentSource="Path to XML Document"  
  5. Transform="XslTransform object"  
  6. TransformSource="Path to XSL Transform Document"  
  7. runat="server">  

Example

customer.xml

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <mydatabase>  
  3. <customer>  
  4. <CustomerID>C001</CustomerID>  
  5. <Name>Win Weerachai</Name>  
  6. <Email>win.weerachai@shotdev.com</Email>  
  7. <CountryCode>TH</CountryCode>  
  8. <Budget>1000000</Budget>  
  9. <Used>600000</Used>  
  10. </customer>  
  11. <customer>  
  12. <CustomerID>C002</CustomerID>  
  13. <Name>Jake Sully</Name>  
  14. <Email>jake.sully@shotdev.com</Email>  
  15. <CountryCode>EN</CountryCode>  
  16. <Budget>2000000</Budget>  
  17. <Used>800000</Used>  
  18. </customer>  
  19. <customer>  
  20. <CustomerID>C003</CustomerID>  
  21. <Name>Tony Stark</Name>  
  22. <Email>tony.stark@shotdev.com</Email>  
  23. <CountryCode>US</CountryCode>  
  24. <Budget>3000000</Budget>  
  25. <Used>600000</Used>  
  26. </customer>  
  27. <customer>  
  28. <CustomerID>C004</CustomerID>  
  29. <Name>Peter Parker</Name>  
  30. <Email>peter.parker@shotdev.com</Email>  
  31. <CountryCode>US</CountryCode>  
  32. <Budget>4000000</Budget>  
  33. <Used>100000</Used>  
  34. </customer>  
  35. </mydatabase>  

Xml.aspx

  1. <%@ Page Language="VB" %>  
  2. <script runat="server">  
  3.   
  4. Sub Page_Load(sender As Object, e As EventArgs)  
  5. Xml1.DocumentSource="~/customer.xml"  
  6. End Sub  
  7.   
  8. </script>  
  9. <html>  
  10. <head>  
  11. <title>ShotDev.Com Tutorial</title>  
  12. </head>  
  13. <body>  
  14. <form runat="server">  
  15. <asp:Xml ID="Xml1" runat="server" ></asp:Xml>  
  16. </form>  
  17. </body>  
  18. </html>  

Screenshot

ASP.NET(vb.net) & Xml - asp:Xml
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.