User-defined classes in Global.asa

B

Brad

Hi,

I've read that one shouldn't include ADO objects in the Global.asa for the
sake of performance, but would user-defined classes cause the same kind of
performance hit? Assuming that they wouldn't, is it possible to do it?

I can't seem to figure out how to include them, nor find any reference to it
in msdn.

Is there a way to do this? Or should I create a slew of Session variables?
Yuck.

<script language='VBScript' runat='server'>
public obj
class Something
public Name
public Value
Sub Class_Initialize()
Name = "Joe"
Value = "Blow"
end Sub
End class
Sub Session_OnStart()
' This won't work
set obj = new Something
' Either will this
set Session("obj") = new Something
End Sub
</script>

Thanks.
 
B

Bob Barrows [MVP]

Brad said:
Hi,

I've read that one shouldn't include ADO objects in the Global.asa
for the sake of performance, but would user-defined classes cause the
same kind of performance hit? Assuming that they wouldn't, is it
possible to do it?

I can't seem to figure out how to include them, nor find any
reference to it in msdn.

Is there a way to do this? Or should I create a slew of Session
variables? Yuck.

<script language='VBScript' runat='server'>
public obj
class Something
public Name
public Value
Sub Class_Initialize()
Name = "Joe"
Value = "Blow"
end Sub
End class
Sub Session_OnStart()
' This won't work
set obj = new Something
' Either will this
set Session("obj") = new Something
End Sub
</script>

Thanks.

http://groups.google.com/groups?hl=en&lr=&c2coff=1&selm=#jlR#2xH$GA.231@cppssbbsa05


http://groups.google.com/groups?hl=...vbscript+class+in+asp+application&btnG=Search

Bob Barrows
 
S

Stephanie Stowe

Brad said:
Hi,

I've read that one shouldn't include ADO objects in the Global.asa for the
sake of performance,

One should not store ADO objects on Session or Application variables. I see
no reason not to use them in the Global.asa file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Global.asa 5
Global.asa 0
Global.asa 2
General global.asa failure 3
Global.asa and Session_OnEnd 1
global.asa EvenId 9 1
Global.asa does not fire after reboot until re-saved. 2
GLOBAL.ASA and IIS 6.0 7

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top