473,504 Members | 13,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Events

Hello,

I have a UserControl that I am added to a page. In the User Control I
created a Public Event:

Public Event DoDelete (ByVal TheIndex as integer)

In a button click of the control I raise the Event:

RaiseEvent DoDelete(txtIndex.text)

I am having a difficult time getting the event to function inside the aspx
page the control is in. Here is how I am trying to accomplish this:

Dim MyControl as UserControl
MyControl = LoadControl("OrderControl.ascx")
Addhandler MyControl.DoDelete, AddressOf MyDelete

When the event in the control fires it does not go to MyDelete in the Aspx
page.

Any Suggestions will be greatly appreciated.

Thanks,
Chuck
Nov 19 '05 #1
2 1446
"Charles A. Lackman" <Ch*****@CreateItSoftware.net> wrote in
news:uy**************@tk2msftngp13.phx.gbl:
Dim MyControl as UserControl
MyControl = LoadControl("OrderControl.ascx")
Addhandler MyControl.DoDelete, AddressOf MyDelete

When the event in the control fires it does not go to MyDelete in the
Aspx page.


Make sure your control has an unique ID for the name.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
Hello,

I do have a Unique ID Name for the control, I just didn't add that in my
code example. IE:

lblCount += 1
MyChildControl = LoadControl("OrderChildControl.ascx")
DCP.Controls.Add(MyChildControl)
MyChildControl.ID = "Cont" & lblCount.ToString
AddHandler MyChildControl.DoDelete, AddressOf MyDelete

The control are added to the page in a button click and not in the page load
event, could this be adding to the problem?

Thanks,

Chuck

----- Original Message -----
From: "Lucas Tam" <RE********@rogers.com>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, August 16, 2005 11:42 AM
Subject: Re: Events
"Charles A. Lackman" <Ch*****@CreateItSoftware.net> wrote in
news:uy**************@tk2msftngp13.phx.gbl:
Dim MyControl as UserControl
MyControl = LoadControl("OrderControl.ascx")
Addhandler MyControl.DoDelete, AddressOf MyDelete

When the event in the control fires it does not go to MyDelete in the
Aspx page.


Make sure your control has an unique ID for the name.

"Charles A. Lackman" <Ch*****@CreateItSoftware.net> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
Hello,

I have a UserControl that I am added to a page. In the User Control I
created a Public Event:

Public Event DoDelete (ByVal TheIndex as integer)

In a button click of the control I raise the Event:

RaiseEvent DoDelete(txtIndex.text)

I am having a difficult time getting the event to function inside the aspx
page the control is in. Here is how I am trying to accomplish this:

Dim MyControl as UserControl
MyControl = LoadControl("OrderControl.ascx")
Addhandler MyControl.DoDelete, AddressOf MyDelete

When the event in the control fires it does not go to MyDelete in the Aspx
page.

Any Suggestions will be greatly appreciated.

Thanks,
Chuck

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2011
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
6
13231
by: Saso Zagoranski | last post by:
Hi! How can I unregister all the events registered to a control? I have seen a piece of code in another thread, which gets all the registered handlers for a specific event. Let's say I have a...
14
12104
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
2
1840
by: Bob Rundle | last post by:
I have the following code, which appears to be working. However it doesn't look right. The part I am wondering about is the logic in DisconnectEvents(). This logic creates a new delegate and...
4
22855
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
11
1839
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
30
3608
by: Burkhard | last post by:
Hi, I am new to C# (with long year experience in C++) and I am a bit confused by the language construct of events. What is it I can do with events that I cannot do with delegates? At the moment...
5
4362
by: Richard Maher | last post by:
Hi, Here I mean "User" in the Programmer or Javascript sense. I merely wish to programmatically trigger an Event. It would be absolutely fantastic if there was a (Form level?) ONUSEREVENT() and...
14
2193
by: xoozlez | last post by:
Hi there, I have a registration form where I like to filter out the past events of 2007. This is the code I am using : strSQL = "SELECT EventID, EventName, EventDateBegin, EventDateEnd,...
1
4879
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.