51Degrees Pipeline .NET  4.1

51Degrees Pipeline for .NET

ExampleFrameworkWebSite/Controllers/HomeController.cs

ASP.NET core exampleThis example shows how to:

  1. Set up configuration options to add elements to the 51Degrees Pipeline.
    {
    "PipelineOptions": {
    "Elements": [
    {
    "BuilderName": "math"
    },
    {
    "BuilderName": "JavaScriptBundlerElement"
    }
    ],
    "ClientSideEnabled": true
    }
    }
  2. Configure client-side code to be run by enabling it in the Web.config.
    1 <configuration>
    2  <system.webServer>
    3  <modules runAllManagedModulesForAllRequests = "true" >
    4  ...
  3. Use the results contained in the Request.Browser instance to display something on a page view.
    public class HomeController : Controller
    {
    ...
    public IActionResult Index()
    {
    ViewData["Message"] =
    Request.Browser["math.operation"] + " = " + Request.Browser["math.result"];
    return View();
    }
    ...

Controller