//The client side event ImageClick takes two parameters, sender and e. //Sender is the object which is raising the event //e is the ImageViewerEventArgs function WebImageViewer_ImageClick(sender, e) { var imageviewer = $find("WebImageViewer1"); // Returns the ImageItem associated with the event var imageItem = e.getImageItem(); // Gets the actual height of the image, not the height displayed in the // browser var imageHeight = imageItem.get_actualHeight(); // Gets the actual width of the image, not the width displayed in the // browser var imageWidth = imageItem.get_actualWidth(); // Get the index of the image item in the WebImageViewer's // ImageItemCollection var imageItemIndex = imageItem.get_index(); // Set the alt text of the image imageItem.set_altText("Image Item"); }
Me.WebImageViewer1.ClientEvents.ImageClick = "WebImageViewer_ImageClick"
this.WebImageViewer1.ClientEvents.ImageClick = "WebImageViewer_ImageClick";