2

I have a repeater that contain a checkbox and I need just to enable some control depend on that checkbox checked status,I used to do so with jQuery using

$("input:checkbox").Click(function(){
    alert('Any code');
});

Now I have an updatepanel contain the repeater that have the checkbox

So I need to get the click event

the way I show here doesn't work !! I don't know why ?

I'm using jQuery 1.4.1 and IE9

AshOoO
  • 1,108
  • 3
  • 13
  • 34

2 Answers2

2

THe updatepanel dynamically adds stuff to your page so you'll need to use jquery .live()

$("input:checkbox").live("click",function(){
    alert('Any code');
});

Or you can use .delegate

$("#ParentToRepeater").delegate("input:checkbox","click",function(){
     alert('Any code');
});
Jishnu A P
  • 14,202
  • 8
  • 40
  • 50
1

Maybe this answer can help you...

Rebinding events in jQuery after Ajax update (updatepanel)

Community
  • 1
  • 1
2GDev
  • 2,478
  • 1
  • 20
  • 32