Logo
Logo
  • Blazor CMS Home
  • Oqtane Tutorials
  • Blazor CMS Home
  • Oqtane Tutorials
Oqtane Tutorials
Oqtane Tutorials

Razor Basics Tutorials

Tutorial Home β€Ί Razor Basics
Work with HTML Output
#5 Working with πŸ˜ƒ Emojis / Emoticons
Reuse Code and Razor Templates
Resources
  • Emojipedia

Working with πŸ˜ƒ Emojis / Emoticons

Emojis or Emoticons are built into all mobile devices and modern desktops. The way they work is that they are actually a very long character code - which automatically works in UTF-8 documents. That is the default in asp.net, so you're good to go.

Just showing Emojis in Source-Code

Check out πŸ™ˆ πŸ™‰ πŸ™Š β˜” πŸŽ„ - I just pasted these into the source code from emojipedia

Below you'll see a helper I created called Boolmoji - it will show a βœ”οΈ or ❌ instead of boolean values.

⬇️ Result | Source ➑️

  • Boolmoji(true) β‡’ ✔️
  • Boolmoji(false) β‡’ ❌
@inherits Custom.Hybrid.RazorTyped

@functions {
  string Boolmoji(bool value) { return value ? "βœ”οΈ" : "❌"; }
}
<ul>
  <li>Boolmoji(true) β‡’ @Boolmoji(true)</li>
  <li>Boolmoji(false) β‡’ @Boolmoji(false)</li>
</ul>

 

Work with HTML Output
#5 Working with πŸ˜ƒ Emojis / Emoticons
Reuse Code and Razor Templates
  • 2sic internet solutions
  • LangΓ€ulistrasse 62, 9470 Buchs SG, Switzerland
  • +41 81 750 67 77
Login