ASP VBSCRIPT 变量声明问题
首先,我
在 .asp 页面中
Class clsTesting
Function hash_call ( methodName,nvpStr )
.....
Set SESSION("nvpReqArray")= deformatNVP( nvpStrComplete )
.....
End Function
end class
遇到一个问题当我执行对此函数的调用时,一旦到达 Set SESSION("nv line 它说错误:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'session'
如何定义变量? 我尝试了 dim SESSION, dim SESSION("nv... 不起作用!
是否在类之外运行它,然后不需要声明这些变量?
First of all, I got a question
in .asp page
Class clsTesting
Function hash_call ( methodName,nvpStr )
.....
Set SESSION("nvpReqArray")= deformatNVP( nvpStrComplete )
.....
End Function
end class
When I perform call to this function, once reach the Set SESSION("nv line
it say error:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'session'
How do I define the variable?
I tried dim SESSION, dim SESSION("nv... not working!
Is it run it outside of class, then no need to declare those variables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
Session["nvpReqArray"] = deformatNVP( nvpStrComplete )
您不需要定义会话变量,它是 asp3 的内置对象之一。
编辑:
选项显式是一个强制您声明所有变量的指令。 (正如您所注意到的。)。
这有助于编程,并有助于确保变量的使用一致。
我建议您使用它。
Try:
Session["nvpReqArray"] = deformatNVP( nvpStrComplete )
You don't need to define a session variable, it's one of the built in objects of asp3.
Edit:
Option explicit is a directive which forces you to declare all variables. (As you've noticed.).
This aids programming, and helps ensure variables are used consistently.
I would recommend you using it.