Hello,
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
Hello,
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
I can't think of another way then just simpy printing it ;
<script type="text/javascript">
var myJavaScripVar = '<%=Model.Property %>';
</script>
Another option is to use an Ajax request to a controller method that returns a json result.