Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Hi..

I am getting the error in following line:

ASP.NET
<asp:CheckBox ID="chkAnmelder" Checked="false" 
    OnCheckedChanged="javascript:AlterChildren();" runat="server" />
The error is following:
) expected.

Why is this so.. please help me as soon as possible

Posted
Updated 25-Nov-09 5:05am
v3

MS IntelliSense might not show it, but since your checking on every click, try the "OnClick=AlterChildren()" instead of OnCheckChanged. I tested this solution with a simple "alert" command inside of a test function, and it worked fine.
 
Share this answer
 

If your checkbox does nothing but call a client-side function, why are you trying to do it with a server-side event?

use something like 

<INPUT TYPE="checkbox" ID="chkAnmelder" VALUE="1" CHECKED="false"  onClick="AlterChildren()">  

Same functionality, less overhead 

 
Share this answer
 
Its client's desire to convert all the html controls into asp controls..
 
Share this answer
 

Nevertheless, your issue is that OnCheckedChanged is a server side event, and it requires a server side function.  You need to put the event for a html control in there, if you want to call on the client side.  OR if there's an OnClientCheckedChanged, call that and make sure it returns false so no server side event is called.

 
Share this answer
 
:thumbsup: :-O :-D ;) :-\ :mad: :omg: :-\ ;P :~ :doh: :( :doh: :laugh: :suss: :-O :) :~ :omg: ;P :laugh: :cool::~:mad: ;P
 
Share this answer
 
Hi dharam,

Use (ClientScript.RegisterClientScriptBlock).It is useful for calling client side code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900