To resolve this problem, manually enter the declaration for
the
Web User control in the code-behind file. The following two code examples
show a Web Form (WebForm1) with an embedded
Button control. You can add the declaration for the
Web User control in the same place that Visual Studio .NET adds the
declaration for the
Button control.
Microsoft Visual C# .NET example
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
protected WebUserControl1 ctlMyControl;
Microsoft Visual Basic .NET example
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents ctlMyControl As WebUserControl1