BUG: Visual Studio .NET does not generate a code-behind declaration for Web User controls (316370)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft ASP.NET (included with the .NET Framework 1.1)
- Microsoft ASP.NET (included with the .NET Framework) 1.0
This article was previously published under Q316370 SYMPTOMS When you create a Web User control and drag it to an .aspx page, Visual Studio .NET does not
automatically generate a code-behind declaration for the Web User control.RESOLUTION 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 STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 8/30/2005 |
---|
Keywords: | kbvs2002sp1sweep kbbug kbCtrlCreate kbide kbpending KB316370 |
---|
|