how would I do the equivalent of this embedded in JavaScript on an MVC2 aspx page:
if (('<%= Model.SomeFunctionEnabled %>' == 'True') and also a whole function code block on a Razor view page (cshtml) in MVC3?
Something like :
@{
foreach(var d in Model.Employees)
{
....
}
}
Which works fine when embedded in the HTML part of the view page.
Thanks
Why testing on the client side when you could do this on the server side and include the javascript to act accordingly if the test succeeds: