Visual studio 在特定日期之前无法隐藏文本行

Visual studio 在特定日期之前无法隐藏文本行,visual-studio,asp-classic,Visual Studio,Asp Classic,我试图隐藏一行文本直到某个日期,然后在到达另一个日期时将其隐藏 你能帮忙吗 我使用的是.asp(经典)页面 这很好,它将在2016年2月12日之后隐藏文本 <% If Date() >= CDate("12/02/2016") Then %> <h3 style="margin:4px 0 3px 0;">TEXT</h3> <% End If %> =CDate(“12/02/2016”)然后%> 正文 但例如,我想将其隐藏到201

我试图隐藏一行文本直到某个日期,然后在到达另一个日期时将其隐藏

你能帮忙吗

我使用的是.asp(经典)页面

这很好,它将在2016年2月12日之后隐藏文本

<% If Date() >= CDate("12/02/2016")   Then %>
<h3 style="margin:4px 0 3px 0;">TEXT</h3>
<% End If %>
=CDate(“12/02/2016”)然后%>
正文
但例如,我想将其隐藏到2016年2月11日,在2016年2月12日显示,然后在2016年2月13日再次隐藏

<% If Date() >= CDate("12/02/2016")  and Date() >= ("13/05/2016") Then %>
<h3 style="margin:4px 0 3px 0;">TEXT</h3>
<% End If %>
=CDate(“12/02/2016”)和Date()>=(“13/05/2016”)然后%>
正文
如果有人能提供帮助,并能在这方面提供任何资源,那就太好了

你的测试

<% If Date() >= CDate("12/02/2016") and Date() >= ("13/05/2016") Then %>
=CDate(“12/02/2016”)和Date()>=(“13/05/2016”)然后%>
有效测试当前日期是否大于或等于2016年5月13日。 你可能想要的是

<% If Date() >= CDate("12/02/2016") and Date() < ("13/05/2016") Then %>
=CDate(“2016年2月12日”)和Date()<(“2016年5月13日”)然后%>
或者更容易阅读

<% If CDate("12/02/2016") <= Date() and Date() < ("13/05/2016") Then %>

如果Date()>=#2016年2月12日#和Date()<#2016年2月14日#
如果您只想在一天内显示它,那么检查
如果DateDiff(“d”,Date,CDate(“12/02/2016”)=0是否会更简单?(检查以确保服务器正确解释bass ackwards日期后。[对不起,我知道mm/dd/yyyy毫无意义,但dd/mm/yyyy更糟糕。]