【发布时间】:2014-09-11 07:22:03
【问题描述】:
我正在研究一些经典的 ASP 函数。
在一个 wsc 文件中,我像这样设置会话。
Session("ordertype") = "morning"
然后在另一个 wsc 文件中检查它是否存在。
If Session("ordertype") Is Nothing Then
' Do stuff here
End if
但每次检查会话是否存在时,应用程序都会停止。
我做错了什么?
【问题讨论】:
-
如果你使用
Session.Contents("ordertype")有什么变化吗? -
if len(Session("ordertype"))>0 then。在这种情况下,我从未使用过“Is Nothing”,不确定是不是你的错误。 -
@MarceloBarbosa 你不会因为它是
string但如果它包含一个对象引用它会。
标签: session asp-classic