Skip to main content

Bug Tracker

Side navigation

#3964 closed bug (invalid)

Opened January 22, 2009 08:02PM UTC

Closed August 07, 2009 05:18PM UTC

Last modified March 15, 2012 03:20PM UTC

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@intel.com
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.

Attachments (0)
Change History (2)

Changed January 22, 2009 08:05PM UTC by alekdavis comment:1

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

Changed August 07, 2009 05:18PM UTC by dmethvin comment:2

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.