I'm implementing asp.net core 3.1 project. In my controller method, I have a ViewData which is assigned by a value of type DateTime. Now in my razor view I need its value in a javascript function. I appreciate if anyone helps me regarding the issue.
What I have till now is using:
<script>
var datePart = @Html.Raw(ViewData["projectStartDate"]);
</script>
But it doesn’t work. I appreciate if anyone could solve my issue.