Click here to Skip to main content
15,895,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,
I want when i check an asp.net check box control execute method in separate javascript file,

this is check box control on the form:



C#
<asp:checkbox id="chkSelectAll" runat="server" onclientclick="CheckUnCheckAll()" >


CheckUnCheckAll() is a method in separate javascript file,
and in Page_Load i write this code:


C#
ClientScriptManager script = Page.ClientScript;
            
script.RegisterClientScriptInclude("MyScript", "MyJavaScriptFile.js");



but it not work properly,
as when i check the checkbox nothing happen and the method inside MyJavaScriptFile.js not execute
Posted
Updated 7-Aug-11 15:59pm
v2
Comments
walterhevedeich 7-Aug-11 21:56pm    
Any error? Can you describe more in details the "not working" part?
shakil0304003 7-Aug-11 22:51pm    
What is the code in the MyJavaScriptFile.js file?

1 solution

why dont' you try OnClick="CheckUnCheckAll()" and make sure your javascript have been included :)
 
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