Export (0) Print
Expand All

IWebEditable.WebBrowsableObject Property

Gets a reference to the WebPart control, user control, or custom control that will be edited by EditorPart controls.

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

Object WebBrowsableObject { get; }

Property Value

Type: System.Object
An object reference to the control associated with an EditorPart control.

The WebBrowsableObject property provides a way for EditorPart controls to get a reference to the server controls they are associated with.

Although the property itself is read-only, the object reference that it returns enables EditorPart controls to change values in the server control.

Notes to Implementers

Normally, when you implement the WebBrowsableObject property in a server control, you simply return a reference to the server control itself. In the case of the GenericWebPart class, because it wraps a child control to enable it to function as a WebPart control, its implementation of the WebBrowsableObject property returns a reference to the child control.

The following code example demonstrates how the WebBrowsableObject property can be overridden in a custom WebPart control. The complete source code required to run the example is found in the Example section of the IWebEditable class overview topic.

The code example overrides both members of the IWebEditable interface.


public override EditorPartCollection CreateEditorParts()
{
  ArrayList editorArray = new ArrayList();
  TextDisplayEditorPart edPart = new TextDisplayEditorPart();
  edPart.ID = this.ID + "_editorPart1";
  editorArray.Add(edPart);
  EditorPartCollection editorParts = 
    new EditorPartCollection(editorArray);
  return editorParts;
}

public override object WebBrowsableObject
{
  get { return this; }
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2014 Microsoft