pre-process click event?

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
 
M

Martin Dechev

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
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top