Control Event

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I created a User Control (.ascx) in my web site.
Inside this control I have a linkbutton.

I want to fire an event when this linkbutton is clicked so that I can
access that event on the page's code where my user controls is added.

How can I do this?

Thanks,
Miguel
 
First you declare a public event within your control such as this example:

Public Event LinkClicked()

Then you raise the event from within your code such as in this example:
RaiseEvent LinkClicked()
 
First you declare a public event within your control such as this example:

Public Event LinkClicked()

Then you raise the event from within your code such as in this example:
RaiseEvent LinkClicked()

Can I raise the event and send a few parameters?

Thanks,
Miguel
 
Yes you can.

Public Event LinkClicked(MyParm as String, ID as Byte)

RaiseEvent LinkClicked(MyString, MyID)
 
Back
Top