tags:

views:

270

answers:

1

Hi,

Having issues where in my .aspx page I pass in a boolean variable (C#) to a javascript function that is expecting a boolean type.

BUt the C# variable returns True, and javascript doesn't like the uppercase.

myjavascript( <%= MyBooleanVariableInCSharp %> );

If I convert the c# variable to string, then my javascript variable becomes a string and not a js bool value!

what is the solution to this nightmare? lol

+5  A: 

Try this:

myjavascript( <%= MyBooleanVariableInCSharp.ToString().ToLower() %> );
Andrew Hare