在会话对象经典ASP库对象 [英] Classic ASP Store objects in the session object

查看:112
本文介绍了在会话对象经典ASP库对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的传统的ASP,我需要code的Web应用程序在传统的ASP因为客户希望它是在传统的ASP。 (

I am new to classic ASP and I need to code a web application in classic asp because the customer wants it to be in classic asp. :(

不管怎么说!这里是我的问题:

Anyways! here is my question:

当我有一个类叫做人的对象:

When I have a object of a class called person:

Class Person
 Private m_sFirstName

 Public Property Get firstName
 firstName = m_sFirstName
 End Property

 Public Property Let firstName(value)
   m_sFirstName = value
 End Property

End Class


set aPerson = new Person
Person.firstName = "Danny"

set Session("somePerson") = aPerson



到目前为止好...

在接下来的要求,我试着念想了会议VAR:

On the next request , I try to read the session var like :

If IsObject(Session("aPerson")) = true Then
    set mySessionPerson = Session("aPerson")

      Response.Write(TypeName(myTest)) // will output "Person" 
      Response.Write(mySessionPerson.firstName) // will output "Object doesn't support this property or method: 'mySessionPerson.firstName'
End If

关于正在发生的事情将会有很大的帮助任何想法。

Any ideas about what is going would be of great help.

推荐答案

这是因为在ASP经典的对象不能序列化。

This is because objects in ASP Classic are not serializable.

下面是一个方法的文章,以模拟ASP经典序列化对象。

Here is an article on a way to simulate serializing objects in ASP Classic.

http://decav.com/blogs/andre/存档/ 2007/02/12 / 1073.aspx

看大约一半在页面保存ASP VBScript的对象到会话。

Look at Saving ASP VBScript "Objects" to Session about half way down the page.

这篇关于在会话对象经典ASP库对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆