using user control in other user control

using user control in other user control

Post by boris_ » Mon, 07 Nov 2005 03:16:33


Hi, all!
I have created controls library (.net winforms) containng several user
controls, i.e. I have one dll (one control library project). I want use
one user control to create other user control dragging it from toolbox.

How I can put first uc in toolbox to be able use it for creating other
uc in the same control library project?
Thank you in advance.
 
 
 

1. persisting changes to a control outside a user control from the user control?

2. Event not firing for user control inside user control

I'm stumped on this problem. I've created a user control that
dynamically creates 5 linkbuttons in the CreateChildControls method.
Each of these child controls is linked to a commandeventhandler, has
command name and argument attached and is assigned a unique id. If I
use this control on a web form everything works fine, the event fires
as planned. However if I contain the control inside another user
control, the event on the linkbutton does not fire. The problem seems
to be tied to the line where the ID property is assigned. If this line
is commented out, the event fires off. Unfortunately I need each of the
linkbuttons to have a unique id so I can access them at the time of the
event. The code is as follows:

protected override void CreateChildControls()
{
for (int x=0;x<5;x++)
{
LinkButton lb = new LinkButton();
lb.Text = "Button " + x.ToString();

lb.ID = this.UniqueID + "lb" + x.ToString();
lb.Command += new CommandEventHandler(OnClick);
lb.CommandName = "Click";
lb.CommandArgument = x.ToString();
this.Controls.Add(lb);
lb.Dispose();
}
base.CreateChildControls ();
}
protected void OnClick(object sender, CommandEventArgs e)
{
LinkButton linkClicked = (LinkButton) this.FindControl(this.UniqueID +
"lb" + e.CommandArgument.ToString());
this.Response.Write("You clicked button " +
e.CommandArgument.ToString());
//do something to control here
linkClicked.Dispose();
}

Any help would be greatly appreciated, I've been beating my head
against the wall for too long on this one...

3. user control or no user control

4. Change web controls in one user control from another user cont

5. How to access: a page from a User control, and another User control from another one?

6. Reference a user controls properties from another user control??

7. User Control within User Control - Event not firing

8. Can User Control inherted from a User Controls?

9. Custom User Control is not rendered inside another user control in

10. Manipulating a User Control from another User Control

11. Custom User Control is not rendered inside another user control in a server table.

12. Showing a WaitDialog user control while another user control is loading

13. User control embedded in user control not recognizing events

14. USER CONTROL = WINDOW USER CONTROL (AND NOT WEB )

15. Accessing USER CONTROL which is inside Masterpage through Another USER Control inside normal page.