Bug Tracker

Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#3964 closed bug (invalid)

Multiple click events fire on a single click

Reported by: alekdavis Owned by:
Priority: minor Milestone: 1.3.2
Component: unfiled Version: 1.3.1
Keywords: click bind event postback UpdatePanel ASP.NET Cc: alek.davis@…
Blocked by: Blocking:

Description

I'm not sure if this is a jQuery issue or an ASP.NET AJAX issue. I have the following code:

$('input:image[id$=\'itemID\']').click( function() {

return confirm("Confirmation message.");

});

ItemID is ID of IMG element in an UpdatePanel control of a Repeater control (ASP.NET 3.5, Visual Studio 2008). This function works fine when the the page is loaded, but after each partial postback (of any UpdatePanel in the Repeater), clicking the IMG element causes multiple events (several confirmation dialogs pop up). I modified the event handler to call unbind and then bind for the click event, but doing so resulted in the event not been called (no confirmation dialogs) until the first partial postback (after the first partial postback it worked fine, though).

I ended up setting the onclick event for the IMG element (<IMG onclick="" .../>), which solved the problem, but I'm suspecting that there may be an issue with jQuery. I can send a sample project if needed.

Change History (2)

comment:1 Changed 11 years ago by alekdavis

Forgot to mention: the same behavior is in Firefox 3 and IE 7.

comment:2 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

This is not a very specific report. If you can reduce it to a simple test case that does not involve ASP.NET, please reopen with the test case.

Note: See TracTickets for help on using tickets.