Example of Linear in ASP.NET MVC ProgressBar Control
This sample illustrates a linear progress bar with determinate and indeterminate states, segments and buffer values.
Determinate
Indeterminate
Segment
Buffer
Active
@Html.UiProgressBar(new UiProgressBarOptions { Id = "lineardeterminate", Value = 100, Thickness = 10, Label = "Determinate" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearindeterminate", Value = 20, IsIndeterminate = true, Thickness = 10, Label = "Indeterminate" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearsegment", Value = 100, SegmentCount = 8, Thickness = 10, Label = "Segment" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearbuffer", Value = 40, SecondaryProgress = 60, Thickness = 10, Label = "Buffer" })
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearactive", Value = 60, IsActive = true, Thickness = 10, Label = "Active" })
<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">
<div class="pb-label">Determinate</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "lineardeterminate", Value = 100, Thickness = 10, Label = "Determinate" })
<div class="pb-label">Indeterminate</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearindeterminate", Value = 20, IsIndeterminate = true, Thickness = 10, Label = "Indeterminate" })
<div class="pb-label">Segment</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearsegment", Value = 100, SegmentCount = 8, Thickness = 10, Label = "Segment" })
<div class="pb-label">Buffer</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearbuffer", Value = 40, SecondaryProgress = 60, Thickness = 10, Label = "Buffer" })
<div class="pb-label">Active</div>
@Html.UiProgressBar(new UiProgressBarOptions { Id = "linearactive", Value = 60, IsActive = true, Thickness = 10, Label = "Active" })
</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/Linear.cshtml; it draws what ViewData holds.
public ActionResult Linear()
{
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 a linear progress bar. A progress bar is used to visualize the progression of an extended operation. The sample shows the determinate and indeterminate states, buffer values and segments of a linear progress bar.