Hi,
Can I catch the event of a WebImageViewer in my .cs file.
Exemple: I want the client side event ImageClick.
I know in VB we can double click on a button and we have a line like that:
protected void WebImageViewer1_ImageClick(object sender, System.EventArgs e)
But with your controls, is it possible and in C#??
thanks you
Gabriel Deschenes
Hello,
You can use the analogous of client side event ItemClick - SelectedIndexChanged. Please take a look at the sample below: <ig:WebImageViewer ID="ImageViewer" runat="server" Height="150px" Width="500px" onselectedindexchanged="ImageViewer_SelectedIndexChanged"> <Items> <ig:ImageItem ImageUrl="http://news.infragistics.com/default.aspx" /> <ig:ImageItem ImageUrl="http://news.infragistics.com/Themes/infragistics/style/images/pods/Media.png" /> <ig:ImageItem ImageUrl="http://news.infragistics.com/default.aspx" /> <ig:ImageItem ImageUrl="http://news.infragistics.com/Themes/infragistics/style/images/pods/Media.png" /> </Items> <ClientEvents ImageClick="Fire" /> </ig:WebImageViewer>
Hope this helps.
Ivan,
The imageclick event does not fire in FireFox. I am using the exact code posted above.
Any sugestions?
Thanks
I made a scenario using FF 3.0.10 and FF 2.0.012, and ItemClick was firing perfectly fine. Here is the code I used:
1. JavaScript handler:<script language="javascript" type="text/javascript">function iClick(webImageViewer, eventArgs){ alert("image clicked: " + eventArgs.getImageItem().get_key());}</script>
2. Handler definition within image viewer:<ClientEvents ImageClick="iClick" />I am also attaching sample page.
Please note - this is only client side event. This means this event does not go to the server (your .cs file).
Hope this helps