views:

18

answers:

1

Is it possible to persist a class in session that I define in VBScript in classic asp:

<script runat=server language=vbscript> 

Class clsCourse 
Private Sub Class_Initialize 
' Statements go here.
End Sub
End Class

dim oCourse
set oCourse=new clsCourse
</script>

How would I persist oCourse in session and recover it from session?

I know session is bad, but this is a high volume application and I'm concerned about hitting the database multiple times in a page call.

+1  A: 

EDIT: Take a look at these answers for a more thorough explanation http://stackoverflow.com/questions/1196525/classic-asp-store-objects-in-the-session-object

Unfortunately you can't store classes in session. This page gives a good explanation:

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=195

One solution could be to make the class a wrapper for an array and just store that array in session.

Castrohenge