Click event in an image

Results 1 to 2 of 2

Thread: Click event in an image

  1. #1
    Join Date
    Dec 1969

    Default Click event in an image

    Greetings, <BR><BR>Here is what I am doing <BR><BR>&#060;IMG id="IMG1" src="imagesusmap.gif" useMap="#usMap" border="0" <BR> <BR>align="absMiddle"&#062; <BR> &#060;map name="usMap"&#062; <BR> &#060;AREA shape="POLY" <BR> coords="304,131,344,128,348,133,330,152,308,143,28 5,149,290,143" <BR> onclick=getMyValue() &#062; <BR> &#060;/map&#062; <BR><BR>Like this i have the co-ordinates set up for 50 states.. <BR><BR>I am trying to access an click event inside a Map.. that is if the <BR>user <BR>clicks one of the states the required information should come on the <BR>same page... I do want to use the href... as i am using some user controls and I will have to reset teh whole page I guess <BR><BR>I have declared the onclick event on the code behind page like <BR><BR>private void getMyValue() <BR>{ <BR> the code........ <BR>} <BR><BR>I am trying the onclick event but I am getting an object expected <BR>error <BR><BR>is is correct what I am doing ?? could someone guide me please with a <BR>snippet of code.. <BR><BR>any better suggestions and your help will be greatly appreciated.. <BR><BR>Thanks a lot in advance <BR>Amruth <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Click event in an image

    Well, I&#039;m not too familar with using image maps, but I think your problem is that you&#039;re trying to set up a server side onclick event handler for a client side onclick event. In other words, your html expects your getMyValue function to be in client side script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts