Back to Devexpress

MenuItem.Name Property

aspnet-devexpress-dot-web-dot-menuitem-b960c479.md

latest3.6 KB
Original Source

MenuItem.Name Property

Gets or sets the unique identifier name for the current menu item.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string Name { get; set; }
vb
<DefaultValue("")>
Public Property Name As String

Property Value

TypeDefaultDescription
StringString.Empty

A string value that specifies the item’s unique identifier name.

|

Remarks

The Name property specifies the unique identifier name for the current menu item. This property can be used at runtime to obtain a particular item specified by its unique identifier name (via the MenuItemCollection.FindByName method) rather than by its index and display text.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Name property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-scheduler-copy-paste-appointment-context-menu-items/CS/WebApplication1/Default.aspx.cs#L78

csharp
DevExpress.Web.MenuItem newItemCopy = new DevExpress.Web.MenuItem();
newItemCopy.Name = "CopyAppointment";
newItemCopy.Text = "Copy";

asp-net-web-forms-create-responsive-web-app/CS/ResponsiveWebApplication/Root.master.cs#L77

csharp
protected void RightAreaMenu_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) {
    if(e.Item.Name == "SignOutItem") {
        AuthHelper.SignOut(); // DXCOMMENT: Your Signing out logic

asp-net-web-forms-scheduler-copy-paste-appointment-context-menu-items/VB/WebApplication1/Default.aspx.vb#L80

vb
Dim newItemCopy As DevExpress.Web.MenuItem = New DevExpress.Web.MenuItem()
newItemCopy.Name = "CopyAppointment"
newItemCopy.Text = "Copy"

See Also

FindByName(String)

js-ASPxClientMenuBase.GetItemByName

js-ASPxClientMenuItem.GetItemByName

Text

MenuItem Class

MenuItem Members

DevExpress.Web Namespace