K
-Karl
Couls someone please advise me on this error. What I am trying to do
is be able to convert an XML document into arrays. I read that the
subs & functions have to be in <script> tags.
Thanks!
Error:
BC30456: 'Read_DOM' is not a member of
'ASP.maps_examples_xml_to_array_aspx'.
Line 53: <asp:Button Text="Read DOM" OnClick="Read_DOM" runat="server"/
Code:
<%@ Import Namespace="System.Xml" %>
<%
Dim randNumbers(1) as Integer
randNumbers(0) = 5
Dim XMLDocument = New XmlDocument
Dim NodeReader = New XmlNodeReader(XMLDocument)
XMLDocument.Load(MapPath("XMLSample.xml"))
While NodeReader.Read()
Dim Spaces As String = Indent(NodeReader.Depth)
If NodeReader.IsStartElement() Then
DOMOut.Text &= "<br/>" & Spaces & "<b>" & NodeReader.Name & "</b>"
DOMOut.Text &= " [Depth: " & NodeReader.Depth & "]"
End If
If NodeReader.NodeType = XmlNodeType.Text Then
DOMOut.Text &= "<b>: </b>" & NodeReader.Value
End If
'List all trees
If NodeReader.Depth = 1 Then
Lbl_Trees.text &= NodeReader.Name & " | "
End if
End While
NodeReader.Close()
%>
<script runat="server" language="vb">
Function Indent(Depth As Integer)
Dim i As Integer
Dim Spaces As String
For i = 1 to Depth
Spaces &= " "
Next
Return Spaces
End Function
</script>
<form runat=server>
<asp:Button Text="Read DOM" OnClick="Read_DOM" runat="server"/>
<P>
<asp:Label id="DOMOut" EnableViewState="False" runat="server"/>
<P>
<asp:Label id="Lbl_Trees" EnableViewState="False" runat="server"/>
</form>
is be able to convert an XML document into arrays. I read that the
subs & functions have to be in <script> tags.
Thanks!
Error:
BC30456: 'Read_DOM' is not a member of
'ASP.maps_examples_xml_to_array_aspx'.
Line 53: <asp:Button Text="Read DOM" OnClick="Read_DOM" runat="server"/
Code:
<%@ Import Namespace="System.Xml" %>
<%
Dim randNumbers(1) as Integer
randNumbers(0) = 5
Dim XMLDocument = New XmlDocument
Dim NodeReader = New XmlNodeReader(XMLDocument)
XMLDocument.Load(MapPath("XMLSample.xml"))
While NodeReader.Read()
Dim Spaces As String = Indent(NodeReader.Depth)
If NodeReader.IsStartElement() Then
DOMOut.Text &= "<br/>" & Spaces & "<b>" & NodeReader.Name & "</b>"
DOMOut.Text &= " [Depth: " & NodeReader.Depth & "]"
End If
If NodeReader.NodeType = XmlNodeType.Text Then
DOMOut.Text &= "<b>: </b>" & NodeReader.Value
End If
'List all trees
If NodeReader.Depth = 1 Then
Lbl_Trees.text &= NodeReader.Name & " | "
End if
End While
NodeReader.Close()
%>
<script runat="server" language="vb">
Function Indent(Depth As Integer)
Dim i As Integer
Dim Spaces As String
For i = 1 to Depth
Spaces &= " "
Next
Return Spaces
End Function
</script>
<form runat=server>
<asp:Button Text="Read DOM" OnClick="Read_DOM" runat="server"/>
<P>
<asp:Label id="DOMOut" EnableViewState="False" runat="server"/>
<P>
<asp:Label id="Lbl_Trees" EnableViewState="False" runat="server"/>
</form>