Example of Tooltip in ASP.NET MVC ProgressBar Control
This sample illustrates a linear progress bar with a tooltip.
HTML5
CSS3
Bootstrap
JavaScript
@Html.UiProgressBar(new UiProgressBarOptions { Id = "lineardeterminate", Value = 75, Thickness = 20, ShowTooltip = true, Label = "HTML5" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearindeterminate", Value = 65, Thickness = 20, ShowTooltip = true, Label = "CSS3" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearsegment", Value = 55, Thickness = 20, ShowTooltip = true, Label = "Bootstrap" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearbuffer", Value = 75, Thickness = 20, ShowTooltip = true, Label = "JavaScript" })
<style>
.pb-wrap { max-width: 760px; margin: 0 auto; padding: 20px 0; }
.pb-label { margin: 18px 0 6px; font-size: 14px; font-weight: 500; }
.pb-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; padding: 20px 0; }
.pb-row figure { margin: 0; text-align: center; }
.pb-row figcaption { margin-top: 8px; font-size: 13px; }
.pb-center { text-align: center; padding: 16px 0; }
.annotaion-pro { font-size: 20px; font-weight: 700; }
</style>
<div class="control-section">
<div class="pb-wrap" style="padding-top: 40px">
<div class="pb-label">HTML5</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "lineardeterminate", Value = 75, Thickness = 20, ShowTooltip = true, Label = "HTML5" })
<div class="pb-label">CSS3</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearindeterminate", Value = 65, Thickness = 20, ShowTooltip = true, Label = "CSS3" })
<div class="pb-label">Bootstrap</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearsegment", Value = 55, Thickness = 20, ShowTooltip = true, Label = "Bootstrap" })
<div class="pb-label">JavaScript</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearbuffer", Value = 75, Thickness = 20, ShowTooltip = true, Label = "JavaScript" })
</div>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class ProgressBarController : Controller
{
// The page is Views/ProgressBar/Tooltip.cshtml; it draws what ViewData holds.
public ActionResult Tooltip()
{
return View();
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
In this example, you can see how to render and configure the linear progress bar with a tooltip. The format and textStyle properties in the tooltip settings can be used to format and customize the tooltip text.