System.Web.UI.WebControls.Adapters.MenuAdapter.RenderItem Method

Renders a single menu item as a hyperlink.

Syntax

protected virtual void RenderItem (System.Web.UI.HtmlTextWriter writer, System.Web.UI.WebControls.MenuItem item, int position)

Parameters

writer
The System.Web.UI.HtmlTextWriter instance containing methods to build and render the device-specific output.
item
The System.Web.UI.WebControls.MenuItem object containing the properties to write to the response stream.
position
The position of the specified System.Web.UI.WebControls.MenuItem object in the menu hierarchy.

Remarks

The MenuAdapter.RenderItem(System.Web.UI.HtmlTextWriter, System.Web.UI.WebControls.MenuItem, int) method is called from the MenuAdapter.RenderContents(System.Web.UI.HtmlTextWriter) method to retrieve the styles and spacing attributes from the System.Web.UI.WebControls.MenuItem object and apply them to a newly created hyperlink element. The menu hierarchy is traversed in the MenuAdapter.RenderContents(System.Web.UI.HtmlTextWriter) method and will call the MenuAdapter.RenderItem(System.Web.UI.HtmlTextWriter, System.Web.UI.WebControls.MenuItem, int) method to render each item. Each item is rendered as a hyperlink and inherits the properties and styles of the specified System.Web.UI.WebControls.MenuItem control. The hyperlink rendered to the page is one of the following:

Requirements

Namespace: System.Web.UI.WebControls.Adapters
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0