This is a Razor Class Library that provides a means to display Flash Messages in an ASP.NET web application. (Razor Pages and MVC are supported.)
It depends on and utilizes Twitter Bootstrap for the alert CSS and HTML.
Currently, Bootstrap 5 is supported.
Check out the Wiki to get started!
You can grab this package from NuGet or by going to the Releases of this repo.
A Flash Message can be thought of as a one time notification.
Perhaps a Welcome message after you sign up for a web site. Or an error notification indicating that an action has failed. They're meant to be seen once and never again.
In a nutshell, this library exports functions and a few Razor View Partials that work in tandem
to display a Flash Message or a Form Alert using TempData
and
Bootstrap for the Alert styling.
By using TempData
, the flash message is only shown
once. A refresh or reload will cause the message to disappear.
- An ASP.NET Web App. Razor Pages and/or MVC supported.
- Bootstrap 5.x.
The FlashMessage.TestingApp
folder contains an ASP.NET Web App that show
off the Flash Message and Form Alert features. It contains both Razor Pages and MVC Examples.
The example app utilizes Swashbuckle.AspNetCore (located at https://localhost:5001/swagger/) to show the MVC endpoints currently mapped.
It also utilizes Serilog.AspNetCore for better logging all around.
- Change directory to the example app.
- Execute
dotnet run
This project is licensed under the MIT License.
You can contact me at robertcato015 at gmail dot com, if you have any questions!
Or feel free to open up an issue or pull request!