I'm trying to use a Boolean MVC ViewBag property that is being set in a controller inside of a javascript if statement. However, there is a problem being introduced because the property value gets converted to Pascal case. For example, "true" becomes "True" and "false" becomes "False".
<script type="text/javascript">
var error = @ViewBag.Dropped;
if ( error ) {
$( '#alert-message' ).addClass('alert-success alert-dismissable');
}
</script>
How can I ensure that the property gets converted to lowercase. I've tried to use javascript function .toLowerCase() and was unsuccessful.