Jan 19, 2010, 3:54 PM
[CLOSED] XRender UserControl NamingContainer
Hi,
In the XRender Example for UserControl, everything works fine. However, I want to set a custom Naming Container for the User Control that is being loaded. How can I do that?
The following is what I tried but give me error:
I hope you got my point...
In the XRender Example for UserControl, everything works fine. However, I want to set a custom Naming Container for the User Control that is being loaded. How can I do that?
The following is what I tried but give me error:
Control xyz=new Control();
xyz = this.LoadControl("xyz.ascx");
xyz.ID="cal";
xyz.NamingContainer.ID="cal1"; (Get Error on this line as "Object Reference not set to an instance of an Object")
Page.Controls.Add(xyz);
If I remove the Naming Container line, the control ID's are prefixed with ctl1_I hope you got my point...