PC Review


Reply
Thread Tools Rate Thread

call to javascript does not work

 
 
Beffmans
Guest
Posts: n/a
 
      8th Aug 2005
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 ***
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      8th Aug 2005
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:(E-Mail Removed)...
> 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 ***



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a javascript when i call an aspx page with a form html not running on server Fabio Mastria Microsoft ASP .NET 4 28th Jan 2008 09:05 AM
Javascript call Kuldeep Microsoft ASP .NET 2 10th Sep 2007 02:49 PM
Please help me how to call this Javascript settyv@gmail.com Microsoft ASP .NET 5 29th Oct 2006 12:28 PM
Call javascript function without using any event call cschang Microsoft ADO .NET 3 1st Feb 2005 03:04 AM
Mixing .NET function into Javascript call doesn't work right... Help =?Utf-8?B?Y2hlZXplYmVldGxl?= Microsoft Dot NET 1 14th Feb 2004 09:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:04 PM.