Ok, here is what I got. I have a TreeView created with the nodes populatated with text and values properties.
Eventually I am going to pass the value of the checked node, but for now I am content with just getting an alert to pop up with the value of the node selected. The problem is that when I try to retrieve the 'value' property of the node, I get the value 'on'.
Here is code populating the:
<asp:TreeView ID="TreeView1" runat="server" ShowLines="True" onclick="client_OnTreeNodeChecked();" ShowCheckBoxes="all">
<Nodes>
<asp:TreeNode ShowCheckBox="True" Text="Parent1" Value="1">
<asp:TreeNode ShowCheckBox="True" Text="Child1" Value="2"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Child2" Value="3"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Parent2" Value="4">
<asp:TreeNode ShowCheckBox="True" Text="Child3" Value="5"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Child4" Value="6"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
Now in javascript I am just calling an alert box to display the value (I will skip the rest of the code by the javascript is called when a node checkbox is selected:
alert(treeNode.title); --> Works, displays the text property of the node
alert(treeNode.value); --> Displays 'on' everytime while I would like for it to display the value of the node
Thanks in advance for any help.
Eventually I am going to pass the value of the checked node, but for now I am content with just getting an alert to pop up with the value of the node selected. The problem is that when I try to retrieve the 'value' property of the node, I get the value 'on'.
Here is code populating the:
<asp:TreeView ID="TreeView1" runat="server" ShowLines="True" onclick="client_OnTreeNodeChecked();" ShowCheckBoxes="all">
<Nodes>
<asp:TreeNode ShowCheckBox="True" Text="Parent1" Value="1">
<asp:TreeNode ShowCheckBox="True" Text="Child1" Value="2"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Child2" Value="3"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Parent2" Value="4">
<asp:TreeNode ShowCheckBox="True" Text="Child3" Value="5"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Child4" Value="6"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
Now in javascript I am just calling an alert box to display the value (I will skip the rest of the code by the javascript is called when a node checkbox is selected:
alert(treeNode.title); --> Works, displays the text property of the node
alert(treeNode.value); --> Displays 'on' everytime while I would like for it to display the value of the node
Thanks in advance for any help.