SyntaxFix
Write A Post
Hire A Developer
Questions
You could use Newtonsoft.Json.
var warningJSON = JsonConvert.SerializeObject(new { warningMessage = "You have been warned..." });