I am receiving this value from the server code in the cshtml file. Its a boolean field and I get boolean value.
Order="@Model.OrderModel.IsToday"
I tried to do this, but unfortunately it says it will be a string when I hover over ToJson.
Order="@Model.OrderModel.IsToday.ToJson()"
How to send this as bool to javascript? I need to explicit cast but my syntax of using bool is wrong I guess.
EDIT
When I use this Order="@Model.OrderModel.IsToday"
in the javascript it says undefined, freaking!
Also tried this
Order="@Json.Encode(Model.OrderModel.IsToday)"
Still sends as string. I don't want to send it as string as its a boolean