How to Set Tooltip for Commands in ASP.NET MVC Toolbar
26 Aug 20261 minute to read
The tooltipText property of the Toolbar item is used to set an HTML Tooltip to the commands that can be viewed as hint text on mouse hover.
Initialize the Tooltip with the Toolbar target. Refer to the following code example:
@(Html.EJS().Toolbar("defaultToolbar")
.Items(new List<ToolbarItem> {
new ToolbarItem { Type = ItemType.Button, TooltipText = "Cut", Text = "Cut" },
new ToolbarItem { Type = ItemType.Button, TooltipText = "Copy", Text = "Copy" },
new ToolbarItem { Type = ItemType.Button, TooltipText = "Paste", Text = "Paste" },
new ToolbarItem { Type = ItemType.Button, TooltipText = "Undo", Text = "Undo" },
new ToolbarItem { Type = ItemType.Button, TooltipText = "Redo", Text = "Redo" }
})
.Render()
)public ActionResult Index()
{
return View();
}The output looks like the following.