VBscript boolean function causes Javscript to bomb

javascript Canada
  • 12 years ago

    Hi there

    I have a server-side VB that runs at the beginning of the asp page, and it returns a result set, call it loResultSet.

    In the client side javscript, I was trying to check to see if this result set is nothing or not.

     if (<%=(loResultSet is nothing)%>)

    {

    // javscript code

    }

     

    However it bombs because that (loResultSet is nothing) returns "True", as opposed to "true", and Javascript doesn't recognize True.

    I know this is a dumb question, but how would you fix this, and I mean, not in a hack way, such as

    if  (%=(loResultSet is nothing)%>.toString().toLowerCase())

     

    Many thanks appreciated.

    CC

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”