N
NKaufman
In my pageload I am adding multiple instances of same User control.
They all have properties ID and ParentID.
Now I also have a button in each User control and am bubbling the
event back to main form. No problem so far.
Now in the event handler method, I get the ID of the user control that
raised the event (through the ID property of sender). I now need to go
through all the user controls on my page to see which one has parentID
matching the ID of the event raising user control.
foreach (Control1 MyCo in this.Page.Controls)
{
Response.Write(MyCo.GetType());
if (MyCo.MyParentID == ParID)
MyCo.Visible = false;
}
I do not see any user control in the output of response.write
Right now, the controls are loaded everytime the page is loaded.
Please help..
They all have properties ID and ParentID.
Now I also have a button in each User control and am bubbling the
event back to main form. No problem so far.
Now in the event handler method, I get the ID of the user control that
raised the event (through the ID property of sender). I now need to go
through all the user controls on my page to see which one has parentID
matching the ID of the event raising user control.
foreach (Control1 MyCo in this.Page.Controls)
{
Response.Write(MyCo.GetType());
if (MyCo.MyParentID == ParID)
MyCo.Visible = false;
}
I do not see any user control in the output of response.write
Right now, the controls are loaded everytime the page is loaded.
Please help..