I saw on stackoverflow we can do this to populate js variables with ViewBags (with razor):
@{
var jss = new System.Web.Script.Serialization.JavaScriptSerializer();
var userInfoJson = jss.Serialize(ViewBag.User);
}
with this:
<script>
//use Json.parse to convert string to Json
var userInfo = JSON.parse('@Html.Raw(userInfoJson)');
</script>
I want to do the same thing with aspx not razor. Can you help me?