Answer the question
In order to leave comments, you need to log in
How to pass the value of an ASP.NET variable to a java script variable?
Good!
I try like this, I crash with an error:
@model Events
<script>
var date = @Model.date;
</script>
Answer the question
In order to leave comments, you need to log in
Please provide the controller code.
Like this, are you passing your model to the View?
public ActionResult Index()
{
...
View("Index", myModel);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question