I want to show a collection of images in list view.
I have an image
table in a MySQL database, the fields are photoId
, PhotoName
, ...
I want to bind the image control Url in the item template of the list view on the physical path (stored in config file) + photoName
in the DB.
ImageUrl ='<%# ConfigurationManager.AppSettings.GetValues("ThePath").First() +
"\\" + "News Images" + "\\" + "Unit #" + Session["UserData"].ToString() +
"_" +"News #"+ NewsIdTextBox.Text + "\\"+Eval("photoName") %>'
but it doesn't work, no photos appeared, only the photos names.
I tried to store the path in the database but it throws an exception.