// The client side event ImageSelected takes two parameters, sender and e. // Sender is the object which is raising the event // e is the ImageViewerEventArgs function WebImageViewer_ImageSelected(sender, e) { var imageViewer = $find("WebImageViewer1"); // Get image selected 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 var imageAlt = imageItem.get_altText(); alert("You have selected an image with the following attributes:\nIndex :: " +imageItemIndex+"\nImage Height :: "+imageHeight+"\nImage Width :: " +imageWidth); }
Me.WebImageViewer1.ClientEvents.ImageSelected = "WebImageViewer_ImageSelected"
this.WebImageViewer1.ClientEvents.ImageSelected = "WebImageViewer_ImageSelected";
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2