UoN.AspNetCore.FeedbackMessage 1.1.0

.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
Install-Package UoN.AspNetCore.FeedbackMessage -Version 1.1.0
dotnet add package UoN.AspNetCore.FeedbackMessage --version 1.1.0
<PackageReference Include="UoN.AspNetCore.FeedbackMessage" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UoN.AspNetCore.FeedbackMessage --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UoN.AspNetCore.FeedbackMessage, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install UoN.AspNetCore.FeedbackMessage as a Cake Addin
#addin nuget:?package=UoN.AspNetCore.FeedbackMessage&version=1.1.0

// Install UoN.AspNetCore.FeedbackMessage as a Cake Tool
#tool nuget:?package=UoN.AspNetCore.FeedbackMessage&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


License Build Status

What is it?

Reusable bits for ASP.NET Core to make displaying feedback messages after action redirects easy.

What are its features?

It provides the following:

  • An enum of Bootstrap 4 based Alert Types
  • A model class representing a Feedback Message
  • Extension methods for setting and getting FeedbackMessageModels at TempData["FeedbackMessage"]
  • A TagHelper for rendering any Feedback Message at TempData["FeedbackMessage"]
  • A Controller for returning a partial view (constructed by the TagHelper); useful for requesting via AJAX to add to a page.
  • An extension method for adding the controller (and partial view) to MVC.


The library targets netstandard2.0 and depends upon ASP.Net Core 2.0 MVC.

If you can use ASP.Net Core 2 MVC, you can use this library.


Acquiring the library


This library is available from nuget.org

Build from source

We recommend building with the dotnet cli, but since the package targets netstandard2.0 and depends only on ASP.Net Core 2.0 MVC, you should be able to build it in any tooling that supports those requirements.

  • Have the .NET Core SDK 2.0 or newer
  • dotnet build
  • Optionally dotnet pack
  • Reference the resulting assembly, or NuGet package.

Standard Server-side usage

  1. Acquire the library via one of the methods above.
  2. Use this.SetFeedbackMessage() inside an MVC Controller method.
  3. Import TagHelpers from this assembly
    • add the following to a Razor View, or to _ViewImports.cshtml:
    • @addTagHelper *, UoN.AspNetCore.FeedbackMessage
  4. Use the <uon-feedbackmessage /> TagHelper in a a Razor View.
  5. ????
  6. PROFIT!
An example:


public class MyController : Controller

    public IActionResult MyAction()
        this.SetFeedbackMessage("Hello!", AlertTypes.Info);
        return View();


    <uon-feedbackmessage />

    The rest of my HTML content is here and very interesting.
  • If a Feedback Message is not set, <uon-feedbackmessage /> will simply collapse into nothing.
  • If a Feedback Message is set, <uon-feedbackmessage /> will turn into something like the following:
<div class="alert alert-info">

AJAX usage

  1. Acquire the library via one of the methods above.
  2. Use services.AddMvc().AddAjaxFeedbackMessageSupport() inside Startup.ConfigureServices()
  3. Optionally specify an MVC Route template for the FeedbackMessageAjaxController, else it will default to /FeedbackMessageAjax as per MVC default conventions
  4. Write some javascript that makes an AJAX request, and puts the result onto the page.
  5. ????
  6. PROFIT!
An example:


public void ConfigureServices(IServiceCollection services)




//global function that assumes we have jquery...
window.feedbackMessage = (message, type) => {
    let feedback = $("#feedback-message"); //this is a div on the page

        url: "/FeedbackMessageAjax",
        data: { "message": message, "type": type },
        success: function(content) {
            //use animation to make it clear the message has changed if there was already one there!
            feedback.fadeOut(200, "swing", function() {



//some situation in which we want a feedback message
window.feedbackMessage("Hello!", "info");


Contributions are welcome.

If there are issues open, please feel free to make pull requests for them, and they will be reviewed.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 730 1/11/2019
2.0.0 631 11/29/2018
1.1.0 955 11/3/2017
1.0.0 791 10/24/2017

This release features AJAX support:

- A Controller and Partial View that can be used to get feedback message html via ajax
- An `IMvcBuilder` extension for registering the aforementioned controller from this assembly.