if ... then ... else语句中的经典asp应用程序变量

时间:2017-08-03 17:04:51

标签: vbscript asp-classic

如果我将变量存储在全局asa Application("emergency") = "Emergency"中,我可以回复&#34;紧急&#34;写<% = Application("emergency") %>。我怎么能在If ... Then ... Else声明中做到这一点?

我正在处理的代码......

<% If date()<= <= #3/29/2017# Then response.write("<div style=""margin:30px 0 0""><!-- #INCLUDE FILE=""file.asp"" --></div>") Else response.write(" = Application("emergency") ") %>

产生错误。没什么帮助。感谢。

1 个答案:

答案 0 :(得分:1)

它会产生错误,因为这不是有效的字符串:

" = Application("emergency") "

注意引号内的引号。

不要试图将代码放入字符串中,只需调用代码:

response.write(Application("emergency"))
相关问题