UserControl event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have a UserControl and in the UserControl I have a few controls (textbox
buttons ect.) and I want to know how can I fire the "onchange" event (of the
usercontrol) when the textbox in the usercontrol is changing.

thanks and i hope you anderstood what am i asking..

Lin.
 
You need to add your own even on the USerCotnrol that gets raised when the
contained control raises its event. So in the code on your USerControl add
something like:

public event EventHandler Change;

The in the DDL's ChangeEvent, raise your event:

if (Change != null) Change(this, EventArgs.Empty);

Then from the containing page you can handle the UserControl's Change event
just like you'd handle a Button's Click event.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Back
Top