How to access Model.Something value in ASP MVC at View's javascript section

asp.net-mvc

Solution

I can't think of another way then just simpy printing it ;

<script type="text/javascript">
    var myJavaScripVar = '<%=Model.Property %>';
</script>

Problem

I would like to access a Model property value in ASP MVC at the View's javascript section What is the best way to do so? Thanks

Original source