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 06:31:18
You legend!!!
 
After about a fortnight worth of posts to various forums
etc. - no-one ever
raised that possibility..
 
I'd just never considered that MS would incorporate the
co-ords into an
ImageButton, when they haven't put it into ImageMap control
-> where it
would logically be required..
 
Anyway so much for needing the custom control.. Still
interested in what the
author did to the client-side postback code that made it
incompatible with
other controls, but I guess it can wait now!
 
Thanks again Peter.
 
Andrew

  _____  

From: Peter Brunone [mailto:peter.brunonegmail.com] 
Sent: Thursday, 22 June 2006 12:03 PM
To: aspnet-controlbuildingaspadvice.com
Subject: [aspnet-controlbuilding] Re: Click event fails when
page includes
dropdownlist with autopostback enabled


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 <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:
ht
tp://www.codeproject.com/useritems/ImageMap2.asp
<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...  I've
created an
example of a functioning and non-functioning page below: 

* Functioning (dropdownlist autopostback enabled):
htt
p://www.thebunse.com/test/clickeventfires.aspx
* Not functioning (dropdownlist autopostback disabled): 
htt
p://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



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 )