473,385 Members | 1,927 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,385 software developers and data experts.

help about unxpected ";"

My web form worked fine before. Today I found three buttons do not work,
including a close button with ID btnClose. I use
btnClose.Attributes.Add("onClick", "window.close()")

in codebehind in VB.

The IE error message on the bottom after page loading:
line: 165
Char:44
Error: unexpected ';'
code:0

I have check line 165 in HTML and VB. I can not find anything. VB is
compiled now. I do not know where the problem is.

David

Mar 31 '06 #1
6 1155
this is purely a javascript error. once the page is open, goto "view
source" and look AROUND page 165...you can post some of the code too here
for more help

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"david" <da***@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
My web form worked fine before. Today I found three buttons do not work,
including a close button with ID btnClose. I use
btnClose.Attributes.Add("onClick", "window.close()")

in codebehind in VB.

The IE error message on the bottom after page loading:
line: 165
Char:44
Error: unexpected ';'
code:0

I have check line 165 in HTML and VB. I can not find anything. VB is
compiled now. I do not know where the problem is.

David

Mar 31 '06 #2


try

btnClose.Attributes.Add("onClick", "window.close();")

you need to keep in mind that sometimes asp.net will tack on additional
items to the onclick that you're not aware of....

thus you need to cleanly close your javascript commands.

if you get desperate.. add

<script language='javascript'>
and
</script>

before the window.close..but I don't think that is the issue.. I think its
the lack of a trailing ; on the end of your line

"david" <da***@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
My web form worked fine before. Today I found three buttons do not work,
including a close button with ID btnClose. I use
btnClose.Attributes.Add("onClick", "window.close()")

in codebehind in VB.

The IE error message on the bottom after page loading:
line: 165
Char:44
Error: unexpected ';'
code:0

I have check line 165 in HTML and VB. I can not find anything. VB is
compiled now. I do not know where the problem is.

David

Mar 31 '06 #3
Sorry. The error message is: expected ';'

I copy the same code to my new web form. It works. but this doesn't.
Here is the HTML code in this line:
<asp:Button id="btnClose" style="Z-INDEX: 133; LEFT: 128px; POSITION:
absolute; TOP: 48px" runat="server"
Text="Close"></asp:Button>
Dabin

"Karl Seguin [MVP]" wrote:
this is purely a javascript error. once the page is open, goto "view
source" and look AROUND page 165...you can post some of the code too here
for more help

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"david" <da***@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
My web form worked fine before. Today I found three buttons do not work,
including a close button with ID btnClose. I use
btnClose.Attributes.Add("onClick", "window.close()")

in codebehind in VB.

The IE error message on the bottom after page loading:
line: 165
Char:44
Error: unexpected ';'
code:0

I have check line 165 in HTML and VB. I can not find anything. VB is
compiled now. I do not know where the problem is.

David


Mar 31 '06 #4
On Fri, 31 Mar 2006 13:55:08 -0600, david
<da***@discussions.microsoft.com> wrote:
Sorry. The error message is: expected ';'

I copy the same code to my new web form. It works. but this doesn't.
Here is the HTML code in this line:
<asp:Button id="btnClose" style="Z-INDEX: 133; LEFT: 128px; POSITION:
absolute; TOP: 48px" runat="server"
Text="Close"></asp:Button>


actually line 165 means the 165th line of javascript, not in the HTML
source. Which is sometimes hard to find if your javascript is spread out
or when ASP.NET .js files get involved :)

--
Craig
Microsoft MVP - ASP/ASP.NET
Mar 31 '06 #5
Thank you. I did figure it out. It need ";" after function name. That is the
problem. But some are still working without ";".
That is funny. However, I have to change all of them.

David

"sloan" wrote:


try

btnClose.Attributes.Add("onClick", "window.close();")

you need to keep in mind that sometimes asp.net will tack on additional
items to the onclick that you're not aware of....

thus you need to cleanly close your javascript commands.

if you get desperate.. add

<script language='javascript'>
and
</script>

before the window.close..but I don't think that is the issue.. I think its
the lack of a trailing ; on the end of your line

"david" <da***@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
My web form worked fine before. Today I found three buttons do not work,
including a close button with ID btnClose. I use
btnClose.Attributes.Add("onClick", "window.close()")

in codebehind in VB.

The IE error message on the bottom after page loading:
line: 165
Char:44
Error: unexpected ';'
code:0

I have check line 165 in HTML and VB. I can not find anything. VB is
compiled now. I do not know where the problem is.

David


Mar 31 '06 #6
as i said, it needs to be the RENDERED html.

Open the page in IE and look for or around the line.

you shouldn't be seeing <Asp:button but rather <input type="button"

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"david" <da***@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Sorry. The error message is: expected ';'

I copy the same code to my new web form. It works. but this doesn't.
Here is the HTML code in this line:
<asp:Button id="btnClose" style="Z-INDEX: 133; LEFT: 128px; POSITION:
absolute; TOP: 48px" runat="server"
Text="Close"></asp:Button>
Dabin

"Karl Seguin [MVP]" wrote:
this is purely a javascript error. once the page is open, goto "view
source" and look AROUND page 165...you can post some of the code too here
for more help

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"david" <da***@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
> My web form worked fine before. Today I found three buttons do not
> work,
> including a close button with ID btnClose. I use
> btnClose.Attributes.Add("onClick", "window.close()")
>
> in codebehind in VB.
>
> The IE error message on the bottom after page loading:
> line: 165
> Char:44
> Error: unexpected ';'
> code:0
>
> I have check line 165 in HTML and VB. I can not find anything. VB is
> compiled now. I do not know where the problem is.
>
> David
>


Mar 31 '06 #7

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

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
0
by: newbie_mw | last post by:
Hi Ian, Thanks for help! The columns and variables are exactly matched so it shouldn't be the problem. Actually the original html and php files are pretty long. But I guess a more detailed...
1
by: newbie_mw | last post by:
Seems my post was buried in more cries for help :-) I will try again. It's probably a very novice question so please take a look! Thanks!...
0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
7
by: tcarvin | last post by:
The .NET studio help system seems to use these odd URLs to locate (html) help files to display. But on my system, I get "Server not found" web errors whenever I access Help. What do I have to do...
9
by: **ham | last post by:
"Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services." This is the message I get each...
3
by: N. Graves | last post by:
Hello, I don't understand this error message." Error accessing File. Network Connection may have been lost." I'm not using any network connection for the database. In the VBA editor is goes...
2
by: Devlei | last post by:
I have added a HelpProvider to my Form, and set the HelpNavigator and HelpKeyword in the Form's properties. When my Form opens and I press F1, the Help activates correctly, but nothing occurs...
0
by: moskie | last post by:
My company is looking into buying some pre-packaged software to implement the "help" portion of our .Net 2.0 web applicaiton. We're looking for something that would perhaps act as a pop-up window...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.