Button Click Event Fires Erratically?

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
 
C

Chris Jackson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top