Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Component Class
 Site Property
Collapse All/Expand All Collapse All
.NET Framework Class Library
Component..::.Site Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the ISite of the Component.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)
Visual Basic
<BrowsableAttribute(False)> _
Public Overridable Property Site As ISite
C#
[BrowsableAttribute(false)]
public virtual ISite Site { get; set; }
Visual C++
[BrowsableAttribute(false)]
public:
virtual property ISite^ Site {
	ISite^ get ();
	void set (ISite^ value);
}
F#
[<BrowsableAttribute(false)>]
abstract Site : ISite with get, set
[<BrowsableAttribute(false)>]
override Site : ISite with get, set

Property Value

Type: System.ComponentModel..::.ISite
The ISite associated with the Component, or nullNothingnullptra null reference (Nothing in Visual Basic) if the Component is not encapsulated in an IContainer, the Component does not have an ISite associated with it, or the Component is removed from its IContainer.

Implements

IComponent..::.Site

A Component will have an ISite if it has been added to an IContainer and the IContainer assigns an ISite to it. The IContainer is responsible for assigning the ISite to the Component. Changing the value of the component's ISite does not necessarily change the name of the site the Component is assigned to. The Site property should be set only by an IContainer.

The property value is nullNothingnullptra null reference (Nothing in Visual Basic) if the Component is removed from its IContainer. Assigning nullNothingnullptra null reference (Nothing in Visual Basic) to this property does not necessarily remove the Component from the IContainer.

A Component might or might not have a name. If a Component is given a name, the name must be unique among other Component objects within its IContainer. The ISite stores the name of the Component; therefore, you can only name a Component if it has an ISite associated with it.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8 Consumer Preview, Windows Server 8 Beta, Windows 7, Windows Server 2008 SP2, Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker