Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MenuAdapter Class

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

Namespace:  System.Web.UI.WebControls.Adapters
Assembly:  System.Web (in System.Web.dll)
public class MenuAdapter : WebControlAdapter, 
	IPostBackEventHandler

The MenuAdapter type exposes the following members.

  NameDescription
Public methodMenuAdapterInitializes a new instance of the MenuAdapter class.
Top
  NameDescription
Protected propertyBrowserGets a reference to the browser capabilities of the client making the current HTTP request. (Inherited from ControlAdapter.)
Protected propertyControlRetrieves a strongly typed reference to the Menu control associated with this MenuAdapter object.
Protected propertyIsEnabledGets a value indicating whether the Web control and all its parent controls are enabled. (Inherited from WebControlAdapter.)
Protected propertyPageGets a reference to the page where the control associated with this adapter resides. (Inherited from ControlAdapter.)
Protected propertyPageAdapterGets a reference to the page adapter for the page where the associated control resides. (Inherited from ControlAdapter.)
Top
  NameDescription
Protected methodBeginRenderCalled 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.)
Protected methodCreateChildControlsCreates the target-specific child controls for a composite control. (Inherited from ControlAdapter.)
Protected methodEndRenderCalled 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.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodLoadAdapterControlStateLoads any control state information that was saved by the SaveAdapterControlState method during a previous request to the page. (Overrides ControlAdapter.LoadAdapterControlState(Object).)
Protected methodLoadAdapterViewStateLoads 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.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnInitRegisters the associated Menu control as one that requires control state. (Overrides ControlAdapter.OnInit(EventArgs).)
Protected methodOnLoadOverrides the OnLoad method for the associated control. (Inherited from ControlAdapter.)
Protected methodOnPreRenderHandles the OnPreRender method for the associated Menu control. (Overrides ControlAdapter.OnPreRender(EventArgs).)
Protected methodOnUnloadOverrides the OnUnload method for the associated control. (Inherited from ControlAdapter.)
Protected methodRaisePostBackEventUsed to maintain the path of the menu when a postback event is raised.
Protected methodRenderGenerates the target-specific markup for the control to which the control adapter is attached. (Inherited from WebControlAdapter.)
Protected methodRenderBeginTagAdds tag attributes and writes the markup for the opening tag of the control to the output stream emitted to the browser or device. (Overrides WebControlAdapter.RenderBeginTag(HtmlTextWriter).)
Protected methodRenderChildrenGenerates the target-specific markup for the child controls in a composite control to which the control adapter is attached. (Inherited from ControlAdapter.)
Protected methodRenderContentsWrites the associated menu items in the associated Menu control to the output stream as a series of hyperlinks. (Overrides WebControlAdapter.RenderContents(HtmlTextWriter).)
Protected methodRenderEndTagCreates final markup and writes the markup for the closing tag of the control to the output stream emitted to the browser or device. (Overrides WebControlAdapter.RenderEndTag(HtmlTextWriter).)
Protected methodRenderItemRenders a single menu item as a hyperlink.
Protected methodSaveAdapterControlStateSaves any changes to the adapter private control state that have occurred since the page was posted back to the server. (Overrides ControlAdapter.SaveAdapterControlState().)
Protected methodSaveAdapterViewStateSaves view state information for the control adapter. (Inherited from ControlAdapter.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Explicit interface implemetationPrivate methodIPostBackEventHandler.RaisePostBackEventEnables the MenuAdapter class to process an event raised when a page is posted back to the server.
Top

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.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.