Calling page server side code from map area.
1) You need to reference area OnClick event to client side script method:
<map name="linkmap"> |
2) Your client side script should use __doPostback to trigger postback
with the image control ID as target. Note that I use href to enable hand
cursor. To prevent the page to transfer to other page I disable the
default click event process.
function CallServer() |
3) to ensure __doPostback existing on the client side I use GetPostBackEventReference in page_load event (server side) :
this.GetPostBackEventReference(this.Image1,""); |
4) on the server side you should check the form hidden field
__EVENTTARGET for the image ID for image "click" event. Image don't have
Click event so you should check for __EVENTTARGET. alternately you can
create your IMG control that derived from IMG and implement click event.