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.

Parents
  • 2700
    Offline posted

    Having done more work here I think that I have uncovered a bug.

    It would seem that the WebImageViewer does not work properly when it is within a WebTab and it is not on the first tab displayed.  I have a web tab with 4 tabs - if I add the WebImageViewer to the first tab it displays correctly.  If I move the control to the second tab when I switch to the tab I do not see any images in the WebImageViewer.  

    Is this something I can work around at all or will I be forced to use some alternative control to display the images?

Reply Children
No Data