How to create annotation on System.Web.UI.WebControls.Image

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In our web application (asp.net) we are trying to create annoation on the
image displayed in System.Web.UI.WebControls.Image control. But there is no
support for mouse events in this control. Is there any way out to do this
using this control or any other control?

Thanks in advance.

Suresh
 
Could you use an Image Button to achieve this? It would post back when the
user clicked on it, and I believe you could then get the X+Y in the post
back event? Not able to test this at the moment, but it seems like the
logical route. Unless you wanted people to actually draw on the image?

If you wanted to get fancy with people clicking, typing in an annotation and
then it submitting, you'd have to go along the route of javascript with a
floating div which is shown when the user clicks on the image - which would
be a normal image control. You'd have a textbox and a submit button in the
div.

Jevon
 
You could do it client side or you could use an input type=image (using HTML
if not provided as a server side control). This way you are able to get the
coordinates where the image is clicked and you could either :
- postback and redisplay all asking for the text
- or do this client side and post only once the text is entered

You'll have also to do some work to display the labels at the appropriate
location...
 
Back
Top