Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.








Boolean.parse Function

Converts a string representation of a logical value to its Boolean Object object equivalent. This function is static and can be invoked without creating an instance of the object.


var booleanVar = Boolean.parse("true");





A string representation of either true or false.

Return Value

A Boolean value (true or false) that corresponds to the value argument.


Exception Type Condition

argumentOutOfRange Function

(Debug) value does not contain a string representation of true or false.


Use the parse function to create a Boolean value from a string representation. The value argument must be "true" or "false" (case insensitive). The string can contain white space. If the string cannot be converted to a Boolean value, an exception is thrown.


The following example shows how to use the parse function to create a Boolean value from a string.


var a = new Boolean(true);      
if (a == true){
    alert("a = true"); 
    alert("a = false");

var b = Boolean.parse("true");
if (b == true){
    alert("b = true"); 
    alert("b = false");