Re: Web - Multiple ImageButtons calling the came function

From: David P. Donahue (ddonahue_at_ccs.neu.edu)
Date: 03/15/05


Date: Tue, 15 Mar 2005 08:25:07 -0500


> 1) Why use a WebServer Control such as the ImageButton if you want to
> handle the event on the client side?

Mostly because I have some additional security that must be put in place
on the server side, and having the server-side and client-side code
intermingling may work, but wouldn't give me the confidence that I need
in the security implementation. In this particular case, the security
needs outweigh the minor performance hit. Not to mention that the only
way I know how to pass values from page to page on the client side is
through a URL query string, which is just ugly :)

Your code for part 2 of my question looks great, that will definitely be
the way to go in this case. The only thing now is putting something in
the DataList's ItemTemplate that tells the image to run a server-side
function when the image is clicked (html image or asp image button,
whatever's easier to point to a server-side function). And, from within
that function, be able to access the properties of the specific image
(its SRC or its ImageURL) that was clicked.

Regards,
David P. Donahue
ddonahue@ccs.neu.edu