Example of Linear flow in ASP.NET MVC Stepper Control
This sample showcases the usage of the Linear property in the Stepper Control.
Description:
- During this phase, the project's scope and objectives are clearly defined, along with the establishment of initial settings and parameters.
- This step involves outlining the primary goals, deliverables, and the overall vision of the project to ensure a comprehensive understanding among all stakeholders.
@Html.UiStepper(new UiStepperOptions { Id = "linear-stepper", Steps = (List<UiStep>)ViewData["LinearStepper"], Linear = true, OnStepChanged = "stepChanged" })
<style>
@@font-face {
font-family: 'Linear_flow';
src:
url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj1tSfUAAAEoAAAAVmNtYXDnE+dkAAABlAAAADxnbHlmoZGpFAAAAdwAAALoaGVhZCX0/mkAAADQAAAANmhoZWEIUQQGAAAArAAAACRobXR4FAAAAAAAAYAAAAAUbG9jYQGGAkoAAAHQAAAADG1heHABGgBuAAABCAAAACBuYW1lwnhb+gAABMQAAAJVcG9zdLnVr9cAAAccAAAAXQABAAAEAAAAAFwEAAAAAAAD9AABAAAAAAAAAAAAAAAAAAAABQABAAAAAQAAlwq5T18PPPUACwQAAAAAAOFxXLwAAAAA4XFcvAAAAAAD9AP0AAAACAACAAAAAAAAAAEAAAAFAGIACwAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5wDnAwQAAAAAXAQAAAAAAAABAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAACAAAAAwAAABQAAwABAAAAFAAEACgAAAAEAAQAAQAA5wP//wAA5wD//wAAAAEABAAAAAEAAgADAAQAAAAAAIIA1gEEAXQABAAAAAAD9APfABcAOQBdAGEAAAEVPwk1LwgPATcXMx8JFQ8OIycVIxElMx8FBxcHJzM1IxE3FwcnFSE/BREvBS0BEQURARIVDQYGBgUFAwMBAwQEBAQGBwgKCQUxBwcNCwoIBgYEAwQCAgEDAwQEBAUFBgwMDRILCh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ABBAkACgBYAPsAAwABBAkACwAkAVMgTGluZWFyX2Zsb3dSZWd1bGFyTGluZWFyX2Zsb3dMaW5lYXJfZmxvd1ZlcnNpb24gMS4wTGluZWFyX2Zsb3dGb250IGdlbmVyYXRlZCB1c2luZyBTeW5jZnVzaW9uIE1ldHJvIFN0dWRpb3d3dy5zeW5jZnVzaW9uLmNvbQAgAEwAaQBuAGUAYQByAF8AZgBsAG8AdwBSAGUAZwB1AGwAYQByAEwAaQBuAGUAYQByAF8AZgBsAG8AdwBMAGkAbgBlAGEAcgBfAGYAbABvAHcAVgBlAHIAcwBpAG8AbgAgADEALgAwAEwAaQBuAGUAYQByAF8AZgBsAG8AdwBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIAB1AHMAaQBuAGcAIABTAHkAbgBjAGYAdQBzAGkAbwBuACAATQBlAHQAcgBvACAAUwB0AHUAZABpAG8AdwB3AHcALgBzAHkAbgBjAGYAdQBzAGkAbwBuAC4AYwBvAG0AAAAAAgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAQIBAwEEAQUBBgAHcHJvamVjdA90by1kby1saXN0LS0tMDINc2hvdy1wcm9ncmVzcwdmaWxlLW9rAAAAAAA=) format('truetype');
font-weight: normal;
font-style: normal;
}
[class^="sf-icon-"], [class*=" sf-icon-"] {
font-family: 'Linear_flow' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.sf-icon-form:before { content: "\e700"; }
.sf-icon-tasksheet:before { content: "\e701"; }
.sf-icon-progress:before { content: "\e702"; }
.sf-icon-submit:before { content: "\e703"; }
#linear-stepper-section {
text-align: center;
}
.linear-stepper-control {
margin: 45px 100px;
}
.linear-stepper-options {
margin: 30px 100px;
}
#linear-stepper-content {
height: 120px;
width: 75%;
margin: 0px 105px;
}
@@media only screen and (max-width: 965px) {
.linear-stepper-control {
width: 100%;
margin: 30px auto;
}
#linear-stepper-content, .linear-stepper-options {
margin: 30px 0px 0px 0px;
width: auto;
height: auto;
left: 25%;
}
}
</style>
<div class="control-section">
<div id="linear-stepper-section">
<div class="ui-btn-group">
<input type="radio" id="linear" name="Linear" value="true" class="ui-btn-group-input" onclick="updateLinear(this)" checked />
<label class="ui-btn" for="linear">Linear</label>
<input type="radio" id="nonLinear" name="Linear" value="false" class="ui-btn-group-input" onclick="updateLinear(this)" />
<label class="ui-btn" for="nonLinear">Non-Linear</label>
</div>
<div class="linear-stepper-control">
@Html.UiStepper(new UiStepperOptions { Id = "linear-stepper", Steps = (List<UiStep>)ViewData["LinearStepper"], Linear = true, OnStepChanged = "stepChanged" })
</div>
</div>
<div id="linear-stepper-content">
<b>Description:</b> <br /><br /> <ul><li>During this phase, the project's scope and objectives are clearly defined, along with the establishment of initial settings and parameters.</li><li>This step involves outlining the primary goals, deliverables, and the overall vision of the project to ensure a comprehensive understanding among all stakeholders.</li></ul>
</div>
<div class="linear-stepper-options" style="display: inline-flex;">
<button type="button" id="previousStep" style="margin-right: 15px; display: none;" onclick="updateBack(this)" class="ui-btn">Back</button>
<button type="button" id="nextStep" onclick="updateNext(this)" class="ui-btn">Next</button>
</div>
</div>
<script>
// Syncfusion's StepChanged: the description follows the active step
function stepChanged(index) { updateContent(index); }
function updateBack() {
var linearStepper = window.Lumen.get('linear-stepper');
linearStepper.previous();
updateContent(linearStepper.getActiveStep());
};
function updateNext() {
var linearStepper = window.Lumen.get('linear-stepper');
linearStepper.next();
updateContent(linearStepper.getActiveStep());
};
function toggleNavigationButtons(activeStep) {
document.getElementById('previousStep').style.display = (activeStep !== 0) ? 'block' : 'none';
document.getElementById('nextStep').style.display = (activeStep !== 3) ? 'block' : 'none';
};
function updateContent(args) {
let stepperContent = document.getElementById('linear-stepper-content');
switch (args) {
case 0:
stepperContent.innerHTML = `<b>Description:</b> <br/><br/> <ul><li>During this phase, the project's scope and objectives are clearly defined, along with the establishment of initial settings and parameters.</li><li>This step involves outlining the primary goals, deliverables, and the overall vision of the project to ensure a comprehensive understanding among all stakeholders.</li></ul>`;
break;
case 1:
stepperContent.innerHTML = `<b>Description:</b> <br/><br/> <ul><li>Task planning involves creating a comprehensive roadmap that outlines specific tasks, sets achievable milestones, and allocates responsibilities among team members. </li>
<li>This phase requires a detailed breakdown of the project's requirements, resources, and a strategic timeline to ensure a systematic and efficient execution of tasks.</li>
</ul>`;
break;
case 2:
stepperContent.innerHTML = `<b>Description:</b> <br/><br/> <ul><li>In this phase, project managers closely monitor the progress of individual tasks, track the overall project's advancement, and regularly update task statuses.</li><li>Continuous assessment of the project's timeline and potential challenges allows for timely adjustments, ensuring that the project stays on course and within the predefined parameters.</li></ul>`;
break;
case 3:
stepperContent.innerHTML = `<b>Description:</b> <br/><br/> <ul><li>
The final phase focuses on the comprehensive evaluation of the project's success, completion of all deliverables, and documentation of lessons learned. </li><li>Analyzing the outcomes and documenting the experiences gained during the project's lifecycle are crucial for improving future project management processes and enhancing overall organizational efficiency.</li>`;
break;
default:
break;
}
toggleNavigationButtons(args);
};
function updateLinear(args) {
var linearStepper = window.Lumen.get('linear-stepper');
linearStepper.setLinear((/true/).test(args.value) ? true : false);
linearStepper.reset();
updateContent(linearStepper.getActiveStep());
};
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class StepperController : Controller
{
// The page is Views/Stepper/Linear.cshtml; it draws what ViewData holds.
public ActionResult Linear()
{
List<UiStep> linearStepper = new List<UiStep>();
linearStepper.Add(new UiStep { IconCss = "sf-icon-form", Label = "Project Setup" });
linearStepper.Add(new UiStep { IconCss = "sf-icon-tasksheet", Label = "Task Planning" });
linearStepper.Add(new UiStep { IconCss = "sf-icon-progress", Label = "Progress Tracking" });
linearStepper.Add(new UiStep { IconCss = "sf-icon-submit", Label = "Project Completion" });
ViewData["LinearStepper"] = linearStepper;
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 a linear process, users progress through steps one after the other in a sequential order. In a non-linear process, users have the flexibility to skip or complete steps in any order they prefer. In this example, the progress status can be interacted with in both a linear and nonlinear manner using the Linear property.