MenuAdapter MenuAdapter MenuAdapter MenuAdapter Class

Definition

Provides the means to modify the behavior of the Menu control for specific browsers.

public ref class MenuAdapter : System::Web::UI::WebControls::Adapters::WebControlAdapter, System::Web::UI::IPostBackEventHandler
public class MenuAdapter : System.Web.UI.WebControls.Adapters.WebControlAdapter, System.Web.UI.IPostBackEventHandler
type MenuAdapter = class
    inherit WebControlAdapter
    interface IPostBackEventHandler
Public Class MenuAdapter
Inherits WebControlAdapter
Implements IPostBackEventHandler
Inheritance
Implements

Remarks

A MenuAdapter modifies the markup or behavior of a Menu control for a specific browser or class of browsers, or acts as a filter on some capability.

By default, the MenuItem objects in the Menu control are rendered as hyperlinks to accommodate menu navigation. The Menu class maintains state by implementing the IPostBackEventHandler interface so that it can respond to and raise specific events during postback. You can extend the MenuAdapter class to further customize rendering or behavior of the Menu control.

The initial request for an adapter causes the .NET Framework to search for a mapped adapter for the control, given the characteristics of the requesting browser. The HttpBrowserCapabilities class uses browser definition files to identify the characteristics of the client browser and to map the adapter to the browser type.

For more information about adaptive rendering in ASP.NET, see Architectural Overview of Adaptive Control Behavior.

Constructors

MenuAdapter() MenuAdapter() MenuAdapter() MenuAdapter()

Initializes a new instance of the MenuAdapter class.

Properties

Browser Browser Browser Browser

Gets a reference to the browser capabilities of the client making the current HTTP request.

(Inherited from ControlAdapter)
Control Control Control Control

Retrieves a strongly typed reference to the Menu control associated with this MenuAdapter object.

IsEnabled IsEnabled IsEnabled IsEnabled

Gets a value indicating whether the Web control and all its parent controls are enabled.

(Inherited from WebControlAdapter)
Page Page Page Page

Gets a reference to the page where the control associated with this adapter resides.

(Inherited from ControlAdapter)
PageAdapter PageAdapter PageAdapter PageAdapter

Gets a reference to the page adapter for the page where the associated control resides.

(Inherited from ControlAdapter)

Methods

BeginRender(HtmlTextWriter) BeginRender(HtmlTextWriter) BeginRender(HtmlTextWriter) BeginRender(HtmlTextWriter)

Called prior to the rendering of a control. In a derived adapter class, generates opening tags that are required by a specific target but not needed by HTML browsers.

(Inherited from ControlAdapter)
CreateChildControls() CreateChildControls() CreateChildControls() CreateChildControls()

Creates the target-specific child controls for a composite control.

(Inherited from ControlAdapter)
EndRender(HtmlTextWriter) EndRender(HtmlTextWriter) EndRender(HtmlTextWriter) EndRender(HtmlTextWriter)

Called after the rendering of a control. In a derived adapter class, generates closing tags that are required by a specific target but not needed by HTML browsers.

(Inherited from ControlAdapter)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
LoadAdapterControlState(Object) LoadAdapterControlState(Object) LoadAdapterControlState(Object) LoadAdapterControlState(Object)

Loads any control state information that was saved by the SaveAdapterControlState() method during a previous request to the page.

LoadAdapterViewState(Object) LoadAdapterViewState(Object) LoadAdapterViewState(Object) LoadAdapterViewState(Object)

Loads adapter view state information that was saved by SaveAdapterViewState() during a previous request to the page where the control associated with this control adapter resides.

(Inherited from ControlAdapter)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnInit(EventArgs) OnInit(EventArgs) OnInit(EventArgs) OnInit(EventArgs)

Registers the associated Menu control as one that requires control state.

OnLoad(EventArgs) OnLoad(EventArgs) OnLoad(EventArgs) OnLoad(EventArgs)

Overrides the OnLoad(EventArgs) method for the associated control.

(Inherited from ControlAdapter)
OnPreRender(EventArgs) OnPreRender(EventArgs) OnPreRender(EventArgs) OnPreRender(EventArgs)

Handles the OnPreRender(EventArgs) method for the associated Menu control.

OnUnload(EventArgs) OnUnload(EventArgs) OnUnload(EventArgs) OnUnload(EventArgs)

Overrides the OnUnload(EventArgs) method for the associated control.

(Inherited from ControlAdapter)
RaisePostBackEvent(String) RaisePostBackEvent(String) RaisePostBackEvent(String) RaisePostBackEvent(String)

Used to maintain the path of the menu when a postback event is raised.

Render(HtmlTextWriter) Render(HtmlTextWriter) Render(HtmlTextWriter) Render(HtmlTextWriter)

Generates the target-specific markup for the control to which the control adapter is attached.

(Inherited from WebControlAdapter)
RenderBeginTag(HtmlTextWriter) RenderBeginTag(HtmlTextWriter) RenderBeginTag(HtmlTextWriter) RenderBeginTag(HtmlTextWriter)

Adds tag attributes and writes the markup for the opening tag of the control to the output stream emitted to the browser or device.

RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter)

Generates the target-specific markup for the child controls in a composite control to which the control adapter is attached.

(Inherited from ControlAdapter)
RenderContents(HtmlTextWriter) RenderContents(HtmlTextWriter) RenderContents(HtmlTextWriter) RenderContents(HtmlTextWriter)

Writes the associated menu items in the associated Menu control to the output stream as a series of hyperlinks.

RenderEndTag(HtmlTextWriter) RenderEndTag(HtmlTextWriter) RenderEndTag(HtmlTextWriter) RenderEndTag(HtmlTextWriter)

Creates final markup and writes the markup for the closing tag of the control to the output stream emitted to the browser or device.

RenderItem(HtmlTextWriter, MenuItem, Int32) RenderItem(HtmlTextWriter, MenuItem, Int32) RenderItem(HtmlTextWriter, MenuItem, Int32) RenderItem(HtmlTextWriter, MenuItem, Int32)

Renders a single menu item as a hyperlink.

SaveAdapterControlState() SaveAdapterControlState() SaveAdapterControlState() SaveAdapterControlState()

Saves any changes to the adapter private control state that have occurred since the page was posted back to the server.

SaveAdapterViewState() SaveAdapterViewState() SaveAdapterViewState() SaveAdapterViewState()

Saves view state information for the control adapter.

(Inherited from ControlAdapter)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IPostBackEventHandler.RaisePostBackEvent(String) IPostBackEventHandler.RaisePostBackEvent(String) IPostBackEventHandler.RaisePostBackEvent(String) IPostBackEventHandler.RaisePostBackEvent(String)

Enables the MenuAdapter class to process an event raised when a page is posted back to the server.

Applies to

See also