Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2700
Adding images server side
posted

I'm having issues adding images to the WebImageViewer and actually getting them to show up.  My code is very simple:-

foreach (string photograph in photographs)
{
String imagePath = "~/Photographs/" + Path.GetFileName(photograph);
lblUrl.Text = imagePath;
Infragistics.Web.UI.ListControls.ImageItem imageItem = new Infragistics.Web.UI.ListControls.ImageItem(imagePath, "Job Photo", "");
imageItem.SelectedCssClass = "mySelectedImageItem";
imageItem.CssClass = "myImageItem";
this.wivJobPhotographs.Items.Add(imageItem);
}

I have a Photographs folder beneath my main application folder and I have checked and there are a bunch of .jpg files.  When I look at the lable which I am using to trace the last image path set it is set to 

~/Photographs/17107_77776674.jpg

which seems correct to me...   However no images are displayed.   Any suggestions please as this should be so simple that I must have missed something.