Skip to main content
Home  › ... Razor

JSON Tutorials

Tutorial HomeJSON
The samples can differ based on your Razor base class or if you're running an old version.
Selected: Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)
Requirements

Working with JSON Data

JSON data can be tricky. The easiest way is to convert it to a dynamic object using AsDynamic(string). Then you can easily use it in your code.

It's important to note that in Typed mode everything is much more strict. 

Since JSON itself is very flexible, you must know what the JSON will contain, to write code which is really type safe. As an alternative you can also always parse it using System.Text.Json.

Error Showing Content - please login as admin for details.
Error Showing Content - please login as admin for details.

 

Error Showing Content - please login as admin for details.