How do I call a javascript function from within razor markup in a cshtml view? Basically I want to do something like this (which doesnt work):
Javascript file being included on the page has a method like this:
<script type="text/javascript">
function doesThisWork() {
return true;
}
</script>
View has code block similar to this:
<div>
@if(doesThisWork()) {
<span> this DOES work!!! </span>
}
else
{
<span> this does NOT work!!! </span>
}
</div>