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