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.
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?
Hi cmdrew,
I have tried something similar to what you describe. I have a WIV in the second tab and add an image item in page load. I see the item in the image viewer when switching to that tab. Do you have a sample that replicates this problem?
regards,David Young