Instead of placing controls on an .aspx page, I tend to create them in a C# class. For me, this architecture not only facilitates code reuse, but makes complex web applications easy to manage. One aspect of this architecture that is always problematic is event handling. My latest project was no exception. Its really a memory issue. That is my memory. Like I can't remember from project to project the correct C# syntax.
The answer is really simple. Lets say you have a control with an ID of "ConcelNewRecord". When clicked, you want to cancel a pending action. Just code the control "Click" property as follows;
You will also need to code the event actions, e.g.;
The above code is encapsulated in a class that is instantiated from an aspx.cs page.