populating a drop down with a file list
my db stores the location of the image, not the image. Of course, the image has been previously loaded, I want to store the full URL of the image into the database. For this I use a drop down list so the user can select it.
So far I've been using this:
'---------------------Image Listing from directory peopertypics in images
Dim strDir As String
strDir = Server.MapPath("~/images/propertypics")
Dim dirInfo as New System.IO.DirectoryInfo(strDir)
Dim arrFiles as System.IO.FileInfo() = dirInfo.GetFiles()
dtgDirInfo.DataSource = arrFiles
dtgDirInfo.DataBind()
'---------------------end image listing
and in the drop down all I get for now is the actual physical path something like c:\xxx\xxx\xxx.jpg
My list box command is the following:
<asp:listbox id="dtgDirInfo" runat="server" Rows="1" DataTextField="fullname" DataValueField="fullname" />
Any ideas of how I can get the URL instead of the physical path?
Thank you so much.
|