How to pass value from cshtm to javascript?

--

step1. use linq read data to array.

step2. use @Html.Raw(Json.Serialize(YourVariable)); to get value from cshtml to javascript block.

--

--

Jameskrauser Lee
Jameskrauser Lee

Written by Jameskrauser Lee

For the last few years. i was involved mostly in the development of Automatic Fare collection system for the Chennai Metro. Familiar with C++ and iOS.

No responses yet