473,382 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Populate Dropdown with File Names

I'm working with an ASP.Net web page that's using C#. I'm trying to
populate a Dropdown with the File Names that reside in an image folder
that's in the same project. So far all I've been able to find is the
below code...and even then that's not quite what I'm after.

DirectoryInfo di = new DirectoryInfo(@"~/Images/Entry/");
FileInfo[] fis = di.GetFiles();
DropDownList5.DataSource = fis;
DropDownList5.DataTextField = "Name";
DropDownList5.DataValueField = "Name";
DropDownList5.DataBind();

Any help in trying to get this resolved quickly would be appreciated.

Thanks

Nov 19 '06 #1
1 1622
One thing I neglected to say...the Dropdown will also reside in the
EditItemTemplate of a Formview. Is there a way to bind that control if
it's there?

Thanks Again

Dave wrote:
I'm working with an ASP.Net web page that's using C#. I'm trying to
populate a Dropdown with the File Names that reside in an image folder
that's in the same project. So far all I've been able to find is the
below code...and even then that's not quite what I'm after.

DirectoryInfo di = new DirectoryInfo(@"~/Images/Entry/");
FileInfo[] fis = di.GetFiles();
DropDownList5.DataSource = fis;
DropDownList5.DataTextField = "Name";
DropDownList5.DataValueField = "Name";
DropDownList5.DataBind();

Any help in trying to get this resolved quickly would be appreciated.

Thanks
Nov 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer...
3
by: Yi Chen | last post by:
We have a drop down list on a PHP page, with several product names, and when people click one item, we will refresh the same page with the product name as parameter, and in turn we want to include...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
1
by: fran7 | last post by:
Hi, Anyone know how to populate a dropdown list with data from database. I have an interface that generates the following code for names in my database. ..asp <%If Trim(rsCard("Author"))<>""...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.