Example of Loading in ASP.NET MVC ProgressBar Control
This sample illustrates a default bullet chart to compare the feature (value) bar with comparative (target) bar. It includes variety of configurations to change the look and feel of the chart.
Loading...
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearProcesscontainer", Value = 40, IsIndeterminate = true, Thickness = 10, Label = "Loading" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "circularprogresscontainer", Type = UiProgressType.Circular, Value = 40, IsIndeterminate = true, Width = "250px", Thickness = 10, ContentTemplate = "#loadingTemplate", Label = "Loading" })
<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; }
.loading-text { font-size: 24px; font-weight: 700; color: var(--ui-accent); }
</style>
<template id="loadingTemplate"><span class="loading-text">Loading...</span></template>
<div class="control-section">
<div class="pb-wrap" style="max-width: 700px">
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearProcesscontainer", Value = 40, IsIndeterminate = true, Thickness = 10, Label = "Loading" })
</div>
<div class="pb-row">
@Html.UiProgressBar(new UiProgressBarOptions { Id = "circularprogresscontainer", Type = UiProgressType.Circular, Value = 40, IsIndeterminate = true, Width = "250px", Thickness = 10, ContentTemplate = "#loadingTemplate", Label = "Loading" })
</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/Loading.cshtml; it draws what ViewData holds.
public ActionResult Loading()
{
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>
Tooltip is enabled in this example, to see the tooltip in action, hover a feature bar or comparative bar on the bullet chart.