IWebEditable.WebBrowsableObject Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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";
  EditorPartCollection editorParts = 
    new EditorPartCollection(editorArray);
  return editorParts;

public override object WebBrowsableObject
  get { return this; }

.NET Framework
Available since 2.0
Return to top