R
rodchar
hey all,
i read in a book that you can load a webusercontrol dynamically without
having to place it on the web form at design time but i can't seem to get it
to work. here a snippet of the code from the book:
UserControl uc;
uc = (UserControl)this.LoadControl("mycontrol.ascx");
this.form1.FindControl("form1").Controls.Add(uc);
One thing i had to change from the example in the book was "UserControl", in
the book it was actually the name of my webusercontrol as the Type but when i
tried to type that in it wouldn't recognize it.
And how do i get to my public properties if this is possible (i'm using c#
code-behind btw).
thanks,
rodchar
i read in a book that you can load a webusercontrol dynamically without
having to place it on the web form at design time but i can't seem to get it
to work. here a snippet of the code from the book:
UserControl uc;
uc = (UserControl)this.LoadControl("mycontrol.ascx");
this.form1.FindControl("form1").Controls.Add(uc);
One thing i had to change from the example in the book was "UserControl", in
the book it was actually the name of my webusercontrol as the Type but when i
tried to type that in it wouldn't recognize it.
And how do i get to my public properties if this is possible (i'm using c#
code-behind btw).
thanks,
rodchar