Posted By

dactivo on 03/29/11


Tagged

EventHandler UserControl


Versions (?)

Event handler in usercontrol


 / Published in: C#
 

  1. En la página:
  2.  
  3. this.AddProductRate.SubmitClicked += new SiteControls_AddRate.SubmitClickedHandler(
  4. ShowRatesFromPage
  5. );
  6.  
  7. En addproductrate:
  8.  
  9. public delegate void SubmitClickedHandler();
  10.  
  11. public event SubmitClickedHandler SubmitClicked;
  12. protected virtual void OnSubmitClicked()
  13. {
  14. // If an event has no subscribers registerd, it will
  15. // evaluate to null. The test checks that the value is not
  16. // null, ensuring that there are subsribers before
  17. // calling the event itself.
  18. if (SubmitClicked != null)
  19. {
  20. SubmitClicked(); // Notify Subscribers
  21. }
  22. }

Report this snippet  

You need to login to post a comment.