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
- C# basics incl. variables and for-each loops
- Razor output to showing the variables as plain text or raw-html.
- Razor helpers
- Shared code - functions, helpers, templates - for re-use across templates
- Working with content (data which is assigned to an instance of a module)
- Working with data from the current App
- Working with data from Queries in the App
- Working with SQL data
- Working with CSV data
- 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