Tooltip for Button Control

19 Dec 20221 minute to read

Tooltip can be shown on Button hover and it can be achieved by setting title attribute.

@Html.EJS().Button("primarybtn").HtmlAttributes(ViewBag.Attributes).Content("Button").IsPrimary(true).Render()

<style>

button {
  margin: 25px 5px 20px 20px;
}

</style>
public ActionResult tooltip()
{   
    Dictionary<string, object> Attributes = new Dictionary<string, object>()
    {
        { "title", "Primary Button" }
    };
    ViewBag.Attributes = Attributes;
    return View();
}

Button with Tooltip

NOTE

View Sample in GitHub.