473,396 Members | 2,036 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,396 software developers and data experts.

problem with two </script> tags

bob
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
Bob

<script runat="server">
Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertedEvent Args)
Dim jv As String
jv = "<script type='text/javascript' language='javascript'>" _
& " alert('Thanks, data are in');" _
& "</script>"
Response.Write(jv)
End Sub
</script>
Oct 18 '06 #1
5 1558
"bob" wrote:
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"
<script runat="server">
Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertedEvent Args)
Dim jv As String
jv = "<script type='text/javascript' language='javascript'>" _
& " alert('Thanks, data are in');" _
& "</script>"
Response.Write(jv)
End Sub
</script>
Sounds like an IDE bug. You could do something like:

& " alert('Thanks, data are in');" _
& "</sc" & "ript>"

Which may trick the IDE into thinking it isn't a closing tag.

Oct 18 '06 #2
bob
Hi, thanks for replying.
I get now the java-error: ; expected

"Leon Mayne" <Le*******@discussions.microsoft.comschreef in bericht
news:21**********************************@microsof t.com...
"bob" wrote:
>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"
<script runat="server">
Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e
As
System.Web.UI.WebControls.DetailsViewInsertedEven tArgs)
Dim jv As String
jv = "<script type='text/javascript' language='javascript'>" _
& " alert('Thanks, data are in');" _
& "</script>"
Response.Write(jv)
End Sub
</script>

Sounds like an IDE bug. You could do something like:

& " alert('Thanks, data are in');" _
& "</sc" & "ript>"

Which may trick the IDE into thinking it isn't a closing tag.

Oct 18 '06 #3
"bob" wrote:
Hi, thanks for replying.
I get now the java-error: ; expected
Looks like the Javascript is wrong, try this:

jv = "<script type='text/javascript' language='javascript'>" &
Environment.NewLine & _
" alert('Thanks, data are in')" & Environment.NewLine & _
"</scr" & "ipt>"
Oct 18 '06 #4
bob
Thanks, but still javascript error (expected ;)
"Leon Mayne" <Le*******@discussions.microsoft.comschreef in bericht
news:A8**********************************@microsof t.com...
"bob" wrote:
>Hi, thanks for replying.
I get now the java-error: ; expected

Looks like the Javascript is wrong, try this:

jv = "<script type='text/javascript' language='javascript'>" &
Environment.NewLine & _
" alert('Thanks, data are in')" & Environment.NewLine & _
"</scr" & "ipt>"


Oct 20 '06 #5
"bob" wrote:
Thanks, but still javascript error (expected ;)
Works OK for me. Do you have any other scripts on the page? Could you do a
'View source' in IE when you get the error and post the complete <script>
section that's causing the problem?
Oct 20 '06 #6

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

Similar topics

2
by: Madhav | last post by:
I have the following statements in my script. ---------------------------------------------------------- textToWrite = "<HTML> \n" + "<HEAD> \n" + "<TITLE>Calendar</TITLE> \n" + "<SCRIPT...
6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
1
by: John MacIntyre | last post by:
Hi, I am having a problem executing server side javascript. For some reason the script tag is ignored when the runat=server is combined with the src attribute. The code is being used client...
1
by: D. Shane Fowlkes | last post by:
I'm a fairly skilled traditional ASP/VB programmer and am learning .NET. I was (recently) surprised to read in a book about declaring and defining all my page Functions in <script...
2
by: Jeffrey T. | last post by:
I had some JavaScript functions defined in the <SCRIPT> section at the top of an aspx page (tested fine there). I then moved the JavaScript functions to their own separate file and then...
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"...
3
by: Jarod_24 | last post by:
My program (it's a webcrawler) downloads htmlpages and in some cases the html has <script> </script> tags in it that generates parts of the html. How can i interpret this javascript and get the...
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> ....
4
by: Alex Maghen | last post by:
When I do this in my page... ClientScript.RegisterStartupScript(this.GetType(), "SomeScript", "alert(\"Hi there\");"); it doesn't work AND when I view source, the alert() line is dumped into the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.