Hello
I learn now asp.net. I need add in html page, like combobox in windows form. How create in html combobox and how add in page.
When i click on it to display all file names for folders "resurces", which is on localhost. Please help.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2011, 2:57 AM EDT
http://www.plus2net.com/javascript_tutorial/list-adding.php
See the working demo if any questions let me know
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 26, 2011, 11:53 PM EDT
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 12:04 AM EDT
And when the page loads the names of these files should be added to my list(this combobox).
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2011, 12:09 AM EDT
string[] folders = System.IO.Directory.GetDirectories(@"Your Path");
DropDownList1.DataSource = folders;
DropDownList1.DataBind();
Try this as per your requirement
string folders = Server.MapPath("your folder that exists in the application");
string[] folders1 = System.IO.Directory.GetFiles(folders);
DropDownList1.DataSource = folders1;
DropDownList1.DataBind();
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 12:18 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2011, 12:25 AM EDT
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 12:35 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2011, 12:36 AM EDT
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 1:06 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2011, 1:14 AM EDT
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 2:51 AM EDT
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 3:54 AM EDT
And how me add in array or in arraylist my names of files from my folder? Here musst too use javascript and how?
Mike JonsonRank #7,584 · 238 reputationPosted Jul 27, 2011, 4:42 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2011, 5:07 AM EDT