List Info

Thread: Click event fails when page includes dropdownlist with autopostback enabled




Click event fails when page includes dropdownlist with autopostback enabled
user name
2006-06-22 02:33:03
Can't you just use an ImageButton control for this? ; I believe the standard <input type=";image";> records coordinates, and that this is how the ImageButton renders.

Regards,

Peter

On 6/20/06, Andrew Haslett <internode.on.net">bunceinternode.on.net> wrote:
Hi all.

We have a requirement to return the (pixel) coordinates specifying where a
user has clicked on an image (its an asp.net front-end hitting a cold-fusion
web-service interacting with a GIS mapping system).

The new ImageMap control in asp.net 2.0 offers a 'Click' event but due to
the way HTML imagemaps work it can't parse the co-ordinates that are
returned in the querystring (they are malformed).

So I found a control that a fellow has made which extends the ImageMap
control making available the coordinates as arguments of the click-event:
http://www.codeproject.com/useritems/ImageMap2.asp

Works great, until I place a standard asp.net dropdown list on the same page
and set its auto-postback property to true. I'm guessing the JS injected by
the dropdown list to hook-up the auto-postback event conflicts with the JS
code written by the custom control to capture the clicked coordinates and
pass them through to the click-event.

Basically the Click-event of the custom control just doesn't fire in this
situation.  I've stepped through the code and everything else in the page
lifecycle fires except the click-event.

Anyway, I'm not too gifted with JS so I was wondering if anyone can spot the
culprit when comparing the output of the two pages...&nbsp; I've created an
example of a functioning and non-functioning page below:

* Functioning (dropdownlist autopostback enabled):
http://www.thebunse.com/test/clickeventfires.aspx
* Not functioning (dropdownlist autopostback disabled):
http://www.thebunse.com/test/clickeventfails.aspx

The code is identical in both pages except for the auto-postback property of
the dropdownlist.

Any ideas?

Thanks in advance,
Andrew

Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )