473,379 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Control Event

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
3 1209
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lance Johnson | last post by:
I would like for when a tab page changes, that my controls on the previous tab page would receive a visiblechanged event or some other event so they are aware of that. We have db locks in some of...
7
by: Colin Young | last post by:
I have a UserControl that contains a calendar control. The calendar is not raising events (month navigation, date selections, etc.). I've checked that the OnSelectionChanged event has a handler...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
5
by: George Durzi | last post by:
I have a simple user control with a text box and a submit button. When the user enters some text into the textbox and clicks the submit button, a record is created in the database. I'm using...
4
by: thomson | last post by:
Hi all, i do have a user control with 4 buttons, and all the events are firing properly, My problem is that i need to right an event handler in the user control, which gets fired after a...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
5
by: Doug Handler | last post by:
Hi, I have a form (Form1) that contains a tab control which one tab has a customer user control (UserControl1). When the user double-clicks on the grid hosted there a new user control is...
1
by: Sylvie | last post by:
I have an Aspx page (Name:"PG") (Contains "UC") and an Ascx Usercontrol (Name:"UC") (Contains "AspxGrid1") I wanna expose Aspxgrid1.rowchanged event to Aspx Page, when user vhanges or...
1
by: Jordan S. | last post by:
I'm just wondering if this would work. Please note that I'm not asking *how* to raise events. I'm clear on that. What I'm not clear on is the sequence in which events are raised by custom controls...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.