Filelist -> Droplist?

L

Lasse Edsvik

Hello

I was wondering if you guys could show me how to fill a droplist with files
from a directory?

I got this but dont work

DirectoryInfo dir = new DirectoryInfo(Server.MapPath("img/"));

DropDown1.DataSource = dir.GetFiles(dir);

DropDown1.DataBind();
 
G

Guest

Hi Edsvik,
make DataSource = dir.GetFiles() instead of dir.GetFiles(dir) and see that
the img folder has some files.

DirectoryInfo dir = new DirectoryInfo(Server.MapPath("img/"));
DropDown1.DataSource = dir.GetFiles();
DropDown1.DataBind();

HTH
srini
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top