By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Control Event

P: n/a
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

May 30 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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()

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"shapper" <md*****@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...
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
May 30 '07 #2

P: n/a
On May 30, 8:42 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<S...@Orr.netwrote:
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()

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"shapper" <mdmo...@gmail.comwrote in message

news:11**********************@u30g2000hsc.googlegr oups.com...
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
Can I raise the event and send a few parameters?

Thanks,
Miguel

May 30 '07 #3

P: n/a
Yes you can.

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

RaiseEvent LinkClicked(MyString, MyID)

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"shapper" <md*****@gmail.comwrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
On May 30, 8:42 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<S...@Orr.netwrote:
>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()

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"shapper" <mdmo...@gmail.comwrote in message

news:11**********************@u30g2000hsc.googleg roups.com...
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

Can I raise the event and send a few parameters?

Thanks,
Miguel
May 31 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.