Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an ascx control in my application which has some checkboxes and checkboxlists.

I want to use javascript for doing some client side processing for these controls.
I have written the javasctript methods in a seperate file and am registering them through the code using Page.ClientScript.RegisterClientScriptBlock.
And the onclick event is subscribed by adding the attributes for onclick

UIControl.Attributes.Add("onchange", "SomeFunction();");

This seems to work fine for the checkbox list items .
But it doesnt work for checkboxes.

What could be going wrong here?
Thanks in advance.
Posted

1 solution

Hi,

try

UIControl.Attributes.Add("onclick", "SomeFunction();");
 
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