UserControl.InitializeAsUserControl Method

Initializes the UserControl object that has been created declaratively. Since there are some differences between pages and user controls, this method makes sure that the user control is initialized properly.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

public:
void InitializeAsUserControl (
	Page^ page
)
public void InitializeAsUserControl (
	Page page
)
public function InitializeAsUserControl (
	page : Page
)
Not applicable.

Parameters

page

The Page object that contains the user control.

The following example calls the InitializeAsUserControl method during the Page_Init stage of request processing. In this case it is initialized from the page itself, but you could initialize it from another control and pass the ID property value of the containing page as the parameter for this method.

No code example is currently available or this language may not be supported.
// Initialize the UserControl object that has been created declaratively. 
myControl.InitializeAsUserControl(this);

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: