My model property MobileNumber may have a value or may be null. I am trying to check for this within my View, using JS.
var mobileNumber = @String.IsNullOrEmpty((Model.MobileNumber));
However the browser console doesn't like this:
Uncaught ReferenceError: True is not defined
It looks like its trying to assign True to the variable mobileNumber:
var mobileNumber = True;
Any idea why this is not working? I can't do checks such as:
if (@Model.MobileNumber == null)
because this ends up as if( == null)
.
when the value is null.