c# - ASP.Net Model to Javascript - Passing Data from server to client -


hey guys quick question best approach on converting model javascript.

i tried using

@{      var arr = new string[3];     arr[0] = "1";     arr[1] = "2";     arr[2] = "3";      var jason = jsonconvert.serializeobject(model);  } <script type="text/javascript">        var string = '@jason';     var variable2 = jquery.parsejson(string);     alert(variable2.id); </script>  

as can guess did not work, through sample of jquery should work not sure if compatible jsonconvert of .net

its first time on programming in client side quite simple question tried looking answer net. see uber complicated answers , @ least 3 , higher old guessing there should easier way now?


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -