Thursday, 3 September 2015

How to convert C# bool to Javascript boolean in Razor .cshtml views

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)

clip_image002

Works a treat too!

clip_image004

Ctrl+Shift+WinKey+B in Windows 10

Ctrl+Shift+WinKey+B in Windows 10  This resets the graphics display on your laptop and can sort out lagging issues as well "Since yeste...