Export (0) Print
Expand All

ProxyWebPart Class

Represents the base class for Web Parts controls that under certain conditions must replace other Web Parts controls on a page.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class ProxyWebPart : WebPart
<asp:ProxyWebPart />

ProxyWebPart is the base class for a set of Web Parts controls, such as UnauthorizedWebPart and ErrorWebPart, that can be used as placeholders for other Web Parts controls on a page. Typically, a ProxyWebPart control will replace another Web Parts control when some type of error or failure has occurred. For example, when a user is not authorized to view a Web Parts control on a page, the intended Web Parts control is replaced with the UnauthorizedWebPart control. When a Web Parts control cannot be loaded or a new instance of it cannot be created, the original Web Parts control is replaced with the ErrorWebPart control. If the intended Web Parts control later becomes available to the user, it will be restored to the page and the object derived from the ProxyWebPart class will be removed.

The ProxyWebPart class does not save view state or control state. If a Web Parts control is replaced by a ProxyWebPart object and then later becomes available, its view state and control state will be empty.

The ProxyWebPart object preserves personalization data for the Web Parts control that it replaced. If the original Web Parts control becomes available, its personalization data will be restored.

When the WebPartManager control saves personalization data, it does not save the properties of a ProxyWebPart object. Instead, it saves the properties of the control that the ProxyWebPart object replaced. If the original Web Parts control becomes available, the WebPartManager control will automatically load it.

The WebPartCollection object contains the ProxyWebPart object. The ID of the intended Web Parts control can be retrieved from the OriginalID property or the GenericWebPartID property.

If a ProxyWebPart object replaces a Web Parts control that is either the provider or consumer of a Web Parts connection, the connection is not activated but will not be deleted. If the original Web Parts control becomes available, the connection will be reactivated.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft