By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

Javascrip with Treeview control in ASP.net 2.0...

P: 8
Hi all,

I am using a treeview control in asp.net. I am populating the nodes and child nodes of the control from a sql database. I have checkboxes for all nodes and child nodes. What I want to do is check all the child nodes on clicking of a parent node on the client side. How do I achieve this? Also I am bit confused on how javascript and asp.net work together?

sorry for posting in this forum i did not know that .net is the right forum for this query.
Apr 14 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 392
What I want to do is check all the child nodes on clicking of a parent node on the client side.
Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3.     <body>
  4.         <input type="checkbox" id="parrentBox" onChange="setChildren('true');" />
  5.         <p>
  6.             <input type="checkbox" id="childBox1" />
  7.             <input type="checkbox" id="childBox2" />
  8.         </p>
  9.     </body>
  10.     <script>
  11.         function setChildren(status) {
  12.             document.getElementById('childBox1').checked = status;
  13.             document.getElementById('childBox2').checked = status;
  14.         }
  15.     </script>
  16. </html>
  17.  


Also I am bit confused on how javascript and asp.net work together?
ASP.net is a server side language that handles tasks on the server. Things like connecting to the database, and rendering the HTML pages. JavaScript is a client side language that runs in the browser. It only runs after the page is created and loaded in the browser.



sorry for posting in this forum i did not know that .net is the right forum for this query.
Since your question relates to JavaScript this is the correct forum.
Apr 14 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.