The samples can differ based on your Razor base class or if you're running an old version.
Switch to Strong-Typed (2sxc 17.06+) Selected: Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)
Switch to Strong-Typed (2sxc 17.06+) Selected: Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)
Resources
Razor Conditions such as if, if-else and ? :
⬇️ Result | Source ➡️
it's green
⬇️ Result | Source ➡️
it's blue
This is important, if you have an code block like an if, and you don't want a span-tag or similar in the output
⬇️ Result | Source ➡️
it's not pink
⬇️ Result | Source ➡️
it's not red
⬇️ Result | Source ➡️
Day of week: Sunday
It's the weekend
It's the weekend
It's the weekend 🥳
⬇️ Result | Source ➡️
Day of week: Sunday
It's the weekend 🥳
It's the weekend 🥳
⬇️ Result | Source ➡️
Title: Title not provided
This requires C# 8 to work, so you must have
- Dnn: 2sxc 17 with the CodeDom and inherits from RazorTyped or newer and have a
@using AppCode
(to force-use the latest compiler with C# 8) - Oqtane: Should always work
⬇️ Result | Source ➡️
Title: Title not provided
Title after change: My Title
Title after change: My Title