473,508 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

8 New Member
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
1 1494
pronerd
392 Recognized Expert Contributor
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

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

Similar topics

5
19868
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a...
8
4392
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
3
2817
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
4
14162
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
10
2331
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a...
1
2540
by: musosdev | last post by:
Hi guys I was using the Microsoft.Web.UI.WebControls extra namespace in my application to provide me with a TreeView control. I was using specifically ..GetNodeFromIndex(), SelectedNodeIndex and...
5
1997
by: david | last post by:
I do not know if there is a treeView control for web form in .NET 1.1. I know there is IE Webcontrol package which has the treeview control for ..net 1.0. I have tested it in .net 1.1 before. It...
0
1975
by: noneya22 | last post by:
I want to use a TreeView control as a one-level, vertical navigation menu. I'm using this control currently with a SiteMapDataSource and .sitemap file. I've written code that associates an image...
0
12773
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.