Bug Tracker

Modify

Ticket #3964 (closed bug: invalid)

Opened 4 years ago

Last modified 15 months ago

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@…
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by alekdavis

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

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.