Dear All,
I am trying to populate dynamically my treeview but unfortunately when I run the code below nothing comes out and I have check my array is not empty as when I view source the codes is there. Any idea how to solve this problem?
<%
Response.Write("<asp:TreeView ID='TreeView1' Runat='server'>");
Response.Write("<nodes>");
for (int i = 0; i < mainMenuNameQuantity; i++)
{
Response.Write("<asp:TreeNode Value='" + mainMenuNameArray + "' Expanded='False' Text='1'>");
Response.Write("<asp:TreeNode Value='Child1A' Text='A' />");
Response.Write("</asp:TreeNode>");
}
Response.Write("</nodes>");
Response.Write("</asp:TreeView>");
%>
I am trying to populate dynamically my treeview but unfortunately when I run the code below nothing comes out and I have check my array is not empty as when I view source the codes is there. Any idea how to solve this problem?
<%
Response.Write("<asp:TreeView ID='TreeView1' Runat='server'>");
Response.Write("<nodes>");
for (int i = 0; i < mainMenuNameQuantity; i++)
{
Response.Write("<asp:TreeNode Value='" + mainMenuNameArray + "' Expanded='False' Text='1'>");
Response.Write("<asp:TreeNode Value='Child1A' Text='A' />");
Response.Write("</asp:TreeNode>");
}
Response.Write("</nodes>");
Response.Write("</asp:TreeView>");
%>