Filelist -> Droplist?

  • Thread starter Thread starter Lasse Edsvik
  • Start date Start date
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();
 
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
 
Back
Top