Version 1, last updated by Andrew Davey at September 01, 2009 18:02 UTC

Use VB's If (ternary) operator.

<%= If(test, _
    <div>true</div>, _
    <div>false</div>) %>

It's just like ?: in C#, so the arguments are lazily evaluated.

If you want to only output something if true (or false) then use Nothing in the other argument.

<%= If(test, _
    <div>true</div>, _
    Nothing) %>