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
Tag Control :
- <asp:Xml id="Xml1"
- Document="XmlDocument object to display"
- DocumentContent="String of XML"
- DocumentSource="Path to XML Document"
- Transform="XslTransform object"
- TransformSource="Path to XSL Transform Document"
- runat="server">
Example
customer.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <mydatabase>
- <customer>
- <CustomerID>C001</CustomerID>
- <Name>Win Weerachai</Name>
- <Email>win.weerachai@shotdev.com</Email>
- <CountryCode>TH</CountryCode>
- <Budget>1000000</Budget>
- <Used>600000</Used>
- </customer>
- <customer>
- <CustomerID>C002</CustomerID>
- <Name>Jake Sully</Name>
- <Email>jake.sully@shotdev.com</Email>
- <CountryCode>EN</CountryCode>
- <Budget>2000000</Budget>
- <Used>800000</Used>
- </customer>
- <customer>
- <CustomerID>C003</CustomerID>
- <Name>Tony Stark</Name>
- <Email>tony.stark@shotdev.com</Email>
- <CountryCode>US</CountryCode>
- <Budget>3000000</Budget>
- <Used>600000</Used>
- </customer>
- <customer>
- <CustomerID>C004</CustomerID>
- <Name>Peter Parker</Name>
- <Email>peter.parker@shotdev.com</Email>
- <CountryCode>US</CountryCode>
- <Budget>4000000</Budget>
- <Used>100000</Used>
- </customer>
- </mydatabase>
Xml.aspx
- <%@ Page Language="VB" %>
- <script runat="server">
- Sub Page_Load(sender As Object, e As EventArgs)
- Xml1.DocumentSource="~/customer.xml"
- End Sub
- </script>
- <html>
- <head>
- <title>ShotDev.Com Tutorial</title>
- </head>
- <body>
- <form runat="server">
- <asp:Xml ID="Xml1" runat="server" ></asp:Xml>
- </form>
- </body>
- </html>
Screenshot