Skip to content

A helper that wraps the TempData Dictionary so you can flash messages in Razor views

Notifications You must be signed in to change notification settings

dan-waters/FlashHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlashHelper

A helper that wraps the TempData Dictionary so you can flash messages in Razor views

You can use any of the following methods in your controller:

this.FlashSuccess("success!");
this.FlashInfo("info!");
this.FlashWarning("warning!");
this.FlashError("error!");

Then, in your Razor view, use

@Html.Flash()

This will produce output like this:

<div class="alert alert-success">success!</div>
<div class="alert alert-info">info!</div>
<div class="alert alert-warning">warning!</div>
<div class="alert alert-error">error!</div>

See Twitter Bootstrap for use of these CSS classes: http://www.tutorialspoint.com/bootstrap/bootstrap_alerts.htm

About

A helper that wraps the TempData Dictionary so you can flash messages in Razor views

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages