pre-process click event?

  • Thread starter Thread starter shland
  • Start date Start date
S

shland

This is related to my previous post on "fire click event from serverside
code?"

Alternately, is there a way to intercept a click event on a control from a
referenced .dll, and do some pre-processing prior to allowing the click
event processing to occur in the .dll?

Background - I'm using a button control from a .dll for which I do not have
source code, and before the .dll processes the button click, I want to save
information entered by the user into a database, or perform some server-side
validation...

Thanks much,
Sheryl
 
Hi, Sheryl,

I think that your only possibility is to inherit from the class of the page.
Detach the method that handles the button click and attach a new handler to
the event. Do what you need to do inside this handler and then call the base
class' method (the old handler). All this depends on the accessibility
levels of the methods and the fields of the base class. i.e. if the method
that handled the click is private you will not be able to call it from the
derived class.

Hope this helps
Martin
 
Back
Top