Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date 如何使用asp classic显示或隐藏日期_Date_Time_Asp Classic_Hide_Show - Fatal编程技术网

Date 如何使用asp classic显示或隐藏日期

Date 如何使用asp classic显示或隐藏日期,date,time,asp-classic,hide,show,Date,Time,Asp Classic,Hide,Show,我使用一个表单给用户在网页上显示或隐藏日期的选项,是或否。 我正在使用cookies存储选项,但我可以找到或弄清楚如何在页面上显示或不显示日期。 我一直在尝试使用IF语句处理yes或no选项,该语句将用作网页的css样式表。 也许我把这一切都搞错了。 当做 特雷夫 编辑从这里开始 到目前为止我的代码(不起作用,甚至不知道我是否在正确的轨道上) css/asp处理样式表中名为styleCookieProcess.asp的代码 <% date= Response.Cookies("usedat

我使用一个表单给用户在网页上显示或隐藏日期的选项,是或否。 我正在使用cookies存储选项,但我可以找到或弄清楚如何在页面上显示或不显示日期。 我一直在尝试使用IF语句处理yes或no选项,该语句将用作网页的css样式表。 也许我把这一切都搞错了。 当做 特雷夫

编辑从这里开始

到目前为止我的代码(不起作用,甚至不知道我是否在正确的轨道上)

css/asp处理样式表中名为styleCookieProcess.asp的代码

<%
date= Response.Cookies("usedate")
If(date= "yes") then
    Response.Cookies("wantdate") = "date()"
ElseIf(date= "no") then
    Response.Cookies("wantdate") = "None"
End If
%>

这是我网页中的代码:

<html>
<head>
<link rel="stylesheet" type="text/css" href="styleCookieProcess.asp">
<title>About Us</title>
</head>

<body>

<p>Current Date &nbsp; <%
Response.Write(Response.Cookies("wantdate"))
%></p>

<P ALIGN = "CENTER">
<IMG SRC = "Images\About_Us.png" HEIGHT = "250" WIDTH = "715">
</P>

<TABLE ALIGN = "CENTER">

<tr>  
<th>
<DIV ALIGN = "CENTER">
<P>
We have been around the block and back and have the t-shirt to prove it!
The Glad Rag Team
</P>
</DIV>
</th>   
</tr>
</TABLE>

</body>
</html>

关于我们
当前日期

我们已经绕了一圈又一圈,我们的t恤衫证明了这一点! 快乐的破布队

你好,伙计们试试这个

<%
date= Response.Cookies("usedate")
If(date= "yes") then
Response.Cookies("wantdate") = "date()"
Else
Response.Cookies("wantdate") = "None"
End If
%>


hi here,我如何在不使用此评论选项卡的情况下发布回复?hi Trevor,你能编辑问题并向我们展示你的代码吗?如果你想发布文本回复,评论字段可以,如果你想在初始问题中添加代码,请单击问题下的编辑链接。太好了,谢谢你的回复Zaf,我现在就这样做