This is what I'm trying to do in my view:
<script type="text/javascript">
@if (ViewBag.scroll != null)
{
console.log("viewbag data: " + @ViewBag.scroll);
}
else
{
console.log("no viewbag data");
}
</script>
I'd like to execute some jQuery code depending if the ViewBag
has data, but it is giving me this error:
the name 'console' does not exist in the current context.