SkillAgentSearch skills...

HeroicSamples.BootstrapAlerts

Illustrates a method of displaying Bootstrap Alert messages in ASP.NET Core applications.

Install / Use

/learn @MattHoneycutt/HeroicSamples.BootstrapAlerts
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Heroic Bootstrap Alerts Sample

This sample shows one technique of combining Bootstrap Alerts with ASP.NET Core. You can read more about the technique at <a target="_blank" href="https://trycatchfail.com">try-catch-FAIL</a>.

Examples

You can show an alert off a view result like so:

public IActionResult About()
{
    ViewData["Message"] = "Your application description page.";

    return View().WithSuccess("It worked!", "You were able to view the about page, congrats!");
}

You can also show an alert off a redirect result:

public IActionResult GoHome()
{
    return RedirectToAction("Index").WithWarning("You were redirected!", "The action you hit has bounced you back to Index!");
}

API results are supported, too:

public IActionResult Success()
{
    return Ok(DateTime.UtcNow.ToString()).WithSuccess("Success!", "The API call worked!");
}
View on GitHub
GitHub Stars12
CategoryDevelopment
Updated5y ago
Forks5

Languages

C#

Security Score

60/100

Audited on Sep 25, 2020

No findings