I have a series of asp:ImageButtons and one asp:Image(Big). Clicking on each ImageButton should change the ImageUrl of asp:Image to a new ImageUrl. How can we handle this using one Javascript function. Because I dont wanna code ImageButton_Click for each and every asp:ImageButton. This makes my appl开发者_开发知识库ication run very slow and also pass too many server requests.
Any ideas ????How to design one powerful Javascript function. By the way when the user clicks on ImageButton...the ImageUrl that has to be set to asp:Image(Big) is same as that of ImageButton. This might help a bit.
Thanks in advance
Do a view source, your asp:image might be shown as img src=... when rendered as html.
You can use document.getElementById() to get the elements and based on the image button click, change their property like: e.g. imageNode = document.getElementById(id); imageNode.href= "google.com";
精彩评论