On this page
@addTagHelper *, Webority.Ui.RazorAfter a redirect
Keep a message across a redirect with TempData.Flash, and the layout shows it once on the next page.
Error summary
A failed post returns its errors, and one tag lists them all without a loop.
Two errors
Fix 2 things before you save
- This company already exists.
- Enter the company name.
Every option
Every value of every prop, one cell each.
TempData.Flash(message)
message: the words the toast shows, such as "Ticket saved."
variant
variant: Success (default)
variant: Info
variant: Warning
variant: Danger
<app-flash />
<app-flash />: takes no attributes; shows the kept message once
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
3 props.
Less common 3 props
| Prop | Type | Default | Description |
|---|---|---|---|
| TempData.Flash(message)default - | string | - | Keeps the words the toast shows for the next page. An empty message throws. |
| variantdefault Success | FlashVariant | Success | The toast's look: Success, Info, Warning or Danger. The second argument of TempData.Flash. |
| <app-flash />default - | - | - | Goes once in the layout. It takes no attributes and shows the kept message once. |