Forum Moderators: open
The control was placed on the page through the nice little drag and drop feature in .net, but when I try to access the controls' initilization method from the page's codebehind, it's never heard of the control.
I tried creating the control {project.control name = new control()}
and then adding it to the form manually {this.controls.add(name)} but that caused all kinds of errors.
Anyone have any ideas?
Not sure if you're using c# or vb, but if you look in the "Web Form Designer Generator Code" you'll see all the other web controls on the page defined. Add the usercontrol similarly:
Protected WithEvents MyControl1 As MyControl
Where:
MyControl1 = name of control on the page
MyControl = User control class name