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

call to javascript does not work

Hi

i have a javascript on my webpage called CallPrint().
However when i trigger it from my asp.button it doesn't work and from my
anchor it does??

Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS1026: ) expected

Source Error:
Line 143: </TBODY>
Line 144:</TABLE>
Line 145:<asp:Button ID="but" Runat="server"
OnClick="javascript:CallPrint('divPrint');"></asp:Button>
Line 146:<a href="javascript:CallPrint 'divPrint');"> link</a>


ch B.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
1 1955
OnClick represents a server side onclick event. To setup a client side one
add it to the Attributes collection:
but.Attributes["onclick"]="CallPrint('divPrint')";

Line 146:<a href="javascript:CallPrint 'divPrint');"> link</a> is obviously
missing a "(".

Eliyahu

<Beffmans> wrote in message news:e5**************@TK2MSFTNGP15.phx.gbl...
Hi

i have a javascript on my webpage called CallPrint().
However when i trigger it from my asp.button it doesn't work and from my
anchor it does??

Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS1026: ) expected

Source Error:
Line 143: </TBODY>
Line 144:</TABLE>
Line 145:<asp:Button ID="but" Runat="server"
OnClick="javascript:CallPrint('divPrint');"></asp:Button>
Line 146:<a href="javascript:CallPrint 'divPrint');"> link</a>


ch B.
*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2

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

Similar topics

9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
8
by: Maverick | last post by:
I want to group all the javascript functions into a file named MiscFunc.js in a asp.net project. ======================================== e.g. In MiscFunc.js function dummyFunc(var1, var2) {...
18
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. ...
4
by: dennise9 | last post by:
My exeternal JS works fine when the call is placed in the page head or body. But if I call the same javascript from a (clicked) text link on the page, the script throws a JS error when it...
6
by: pronerd | last post by:
Hi, I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like parent.ToolMenuFrame.location.href =...
1
by: mikegolden | last post by:
An application I'm working on makes extensive use of output parameters and return values, thus forcing me to use the ADODB Command object to execute the stored procs. For recordset returning stored...
29
Frinavale
by: Frinavale | last post by:
I have 2 FireFox (version 2) browser windows opened. One is the child of the other. When the user is finished with the child window, a method in the parent window is called to refresh a...
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
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
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
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.