Results 1 to 3 of 3

Thread: Making a User Control fire an event

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved Making a User Control fire an event

    Let's say I have a user control with a couple of buttons.
    I need an event to fire on my page when either of these buttons is clicked.

    How can I do that?
    Last edited by wey97; Nov 10th, 2004 at 09:47 AM.

  2. #2
    Member
    Join Date
    Jan 2003
    Location
    Ft. Lauderdale, FL
    Posts
    33
    Here is an excellent article which address exactly your issue:
    http://www.ftponline.com/vsm/2002_11...efault_pf.aspx

    I hope this helps!
    Rich J Defilippo

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You can simply declare a public event at the top of your user control class, and whenever a button is clicked on your usercontrol, handle the event and raise the public event.
    VB Code:
    1. Public Class myusercontrol
    2.  
    3.  Public Event SaveRequested
    4.  
    5.  Private Sub SaveButton_Click(sender as Object, e as System.event.args) Handles SaveButton.Click
    6.  
    7.  RaiseEvent SaveRequested
    8.  End Sub
    9. End Class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width