使用IF语句打印HTML

时间:2015-06-17 00:04:12

标签: html asp-classic

我将一个小的PHP脚本转换为clasic ASP,但我不知道如何在ASP中执行此操作

<?php if ($anyCondition == true): ?>
<p>This is a HTML paragraph, it will be printed if $anyCondition will be true</p>
<?php else: ?>
<p>This is another HTML paragraph, it will be printed if $anyCondition will be false</p>
<?php endif; ?>

有可能吗?是否有类似的替代方案?

1 个答案:

答案 0 :(得分:1)

已经有一段时间......如果我能记住的话,应该是这样的:

<% If anyCondition = True Then %>

<p>This is a HTML paragraph, it will be printed if <%=anyCondition%> will be true</p>

<% Else %>

<p>This is another HTML paragraph, it will be printed if <%=anyCondition%> will be false</p>

<% End If %>