Skip to main content
Home  ›  Blog

New Razor Tutorial (with app) for DNN & 2sxc

Razor and MVC are gradually replacing the old web controls in DNN. To help you quickly get started - or lookup some snippet you forgot - we created an online tutorial.

What's inside

  1. C# basics incl. variables and for-each loops
  2. Razor output to showing the variables as plain text or raw-html.
  3. Razor helpers
  4. Shared code - functions, helpers, templates - for re-use across templates
  5. Working with content (data which is assigned to an instance of a module)
  6. Working with data from the current App
  7. Working with data from Queries in the App
  8. Working with SQL data
  9. Working with CSV data
  10. Working with Koi to ensure that Bootstrap4 is always included

Lots more will come, up next will be LINQ with dynamic data (tricky), automatic image resizing and working with multi-language data. 

Online Browse Mode

To use the tutorial online (or just to copy a snippet) visit the Razor Tutorial in our new DNN-Tutorials section. 

Play around with the Code

We created the tutorial as a DNN App, so you can also install it on your DNN and play around with the code. You can find the latest Razor Tutorial in the App Catalog.

Have fun!
iJungleboy


Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.

Read more posts by Daniel Mettler