473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

error when using <% %>and <script></script> tags

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 <scripttags.

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 &= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
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>

Jun 15 '07 #1
2 2041
On Jun 15, 9:43 am, -Karl <dino...@gmail.comwrote:
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 <scripttags.

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 &= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
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>
Well, functions and subs have to be in <scripttags. Anyway, from an
architectural point of view, you are implementing bussines logic in a
page. Whay don't you move this code to another class and make it
reusable from all over the application? And why you don't use code-
behind's visual studio feature to separete code from presentation?
Good luck.

Jun 17 '07 #2
On Jun 17, 10:48 am, Cubaman <oscar.acostamonte...@googlemail.com>
wrote:
On Jun 15, 9:43 am, -Karl <dino...@gmail.comwrote:


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 <scripttags.
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 &= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
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>

Well, functions and subs have to be in <scripttags. Anyway, from an
architectural point of view, you are implementing bussines logic in a
page. Whay don't you move this code to another class and make it
reusable from all over the application? And why you don't use code-
behind's visual studio feature to separete code from presentation?
Good luck.- Hide quoted text -

- Show quoted text -
I am coding this via a notepad like editor. I don't use VS and I
haven't yet look into code behinds (Somewhat complex right now)
What do you mean by seperate class?
I was wanting to keep this piece together for simplicity of managing
the code. I am not planning on reusing this code anywhere in my
project but I understand the value of making this a function for
future use.


Jun 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
10
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
1
by: Grzegorz ¦lusarek | last post by:
Hello everyone. I1m writing webb aplication using AJAX (prototype library: http://prototype.conio.net/ and scriptacuolous:http://script.aculo.us/). My Problem is that that I'm doing...
1
by: JMMB | last post by:
The <script> tags work in a htm page, but when I convert it to .aspx page, it stops working? I get a IE script error. What might be the mistake here? thanks, <HTML> <HEAD> <TITLE> Teste...
21
by: hemant.singh | last post by:
Hello all, I am try'g to send window.location.href to the server script who will generate dynamic javascript according to the referral name comg in as param Now bcz <script language="javascript"...
12
by: Iddo | last post by:
Hi, I am having a strange problem... I have an HTML file which has 2 script tags: 1) <script language="javascript" id="ABC" src="ABC.js" /> 2) <script id="general" language="javascript">...
44
by: rhythmace | last post by:
W3C HTML validator passes this: .... <script type="text/javascript" src="foo.js"> <script type="text/javascript"> ....script in here... </script> ....
5
by: bob | last post by:
Hi, This code gives two errors, one on each </scripttag: the first: "statement cannot appear in method body" the last: "end of tag has no matching start tag" Any way to solve this? Thanks...
1
by: Harper1975 | last post by:
My question is because of the processing differences between inline and <script> on the server-side, under what conditions would you use <script>?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.