I was wanting a clean way to convert a C# Boolean property on a view model into a javascript true / false bit of text for passing into our Typescript context settings constructors, and stumbled upon this way …
@Json.Encode(Model.BoolPropertyName)
Works a treat too!
Merrick Chaffer'S Blog: How To Convert C Bool To Javascript Boolean In Razor .Cshtml Views >>>>> Download Now
ReplyDelete>>>>> Download Full
Merrick Chaffer'S Blog: How To Convert C Bool To Javascript Boolean In Razor .Cshtml Views >>>>> Download LINK
>>>>> Download Now
Merrick Chaffer'S Blog: How To Convert C Bool To Javascript Boolean In Razor .Cshtml Views >>>>> Download Full
>>>>> Download LINK