Button Click Event Fires Erratically?

  • Thread starter Thread starter Big_Stu
  • Start date Start date
B

Big_Stu

Hi all,

I have an <asp:button> inside an <asp:table> and I am finding that the
button click event doesn't fire at all! I have added the button to the
initialize component event, and the table.

The event fires when I change the access modifier to Protected, from
Private, but then it fires only every so often, and there is no pattern.

Can anybody tell me what is happening, why and what I need to do?

Thanks
 
Your method must be protected if you want it to work. Keep in mind that
there are two separate classes that are built and compiled here: the code
behind is one class, and another class is dynamically built for your aspx
page. So, if you declare your handler as private, then the new class that is
generated is unable to access that method. You must implement it as
protected.

As for it firing erratically, I would hook up a debugger and step your way
through it to see what code path it is taking and why it isn't hitting what
you want it to.
 
Back
Top