I have tried using Treeview in my Sanboxsolution webpart but the problem is that in a web page it is not loading properly. And when i click on node it gives me javascript error. For these two errors i have attached screenshots with this question for the reference.Have a look at it.
And in my aspx view i have written following code
<asp:TreeView runat="server" ID="trvComDept" ShowLines="True" ShowExpandCollapse="true" EnableClientScript="true" ImageSet="Simple">
<Nodes>
<asp:TreeNode Text="Parent 1" Value="1">
<asp:TreeNode Text="Child 1" Value="2"></asp:TreeNode>
<asp:TreeNode Text="Child 2" Value="3"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
Webpage View

JS Error when i click on node

Updated Code Is As Below
Aspx Code :-
<asp:TreeView runat="server" ID="trvComDept" ShowLines="True" ShowExpandCollapse="true" EnableClientScript="true" ImageSet="Simple">
C# Code :
List<string> Roots = new List<string>();
List<string> Childs = new List<string>();
for (int i = 0; i < 5; i++)
{
Roots.Add("Root" + i.ToString());
Childs.Add("Child" + i.ToString());
}
foreach (string r in Roots)
{
TreeNode root = new TreeNode();
root.Text = r;
foreach (string c in Childs)
{
TreeNode child = new TreeNode();
child.Text = c;
root.ChildNodes.Add(child);
}
trvComDept.Nodes.Add(root);
}
