Control Event

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
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

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()
 
S

shapper

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
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

Yes you can.

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

RaiseEvent LinkClicked(MyString, MyID)
 

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

Similar Threads

Event 0
Bubble Event 2
Raise Event 1
Event in Web Control 1
Event not firing for user control inside user control 4
Control Event 1
Event 0
User Control 2

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top