I want to get the names of some folders in my drive and populate my menu control with the names of those folders.
Getting the folder names is not the issue, but how can i populate my menu with the names of getted foldernames.
I tried this:
DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("~\\MyFolders\\"));
DirectoryInfo dirs = dirInfo.GetDirectories();
Menu1.DataSource = dirs;
But im getting the error:
HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.
How can i achieve this?
Thanks in advance.
View Complete Post