Saturday, May 11, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
88
rated 0 times [  91] [ 3]  / answers: 1 / hits: 50295  / 16 Years ago, wed, march 18, 2009, 12:00:00

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


More From » c#

 Answers
12

Try this:



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

[#99830] Thursday, March 12, 2009, 16 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
angelr

Total Points: 399
Total Questions: 96
Total Answers: 101

Location: Finland
Member since Sun, May 21, 2023
1 Year ago
angelr questions
Tue, Sep 14, 21, 00:00, 3 Years ago
Mon, Dec 30, 19, 00:00, 4 Years ago
Sun, Jul 7, 19, 00:00, 5 Years ago
;