SoFunction
Updated on 2025-04-09

Object-oriented classes in ASP


<%
class MyClass
Dim var 'Common variables must use Dim
Private var2' private variable is not required

Sub sub1
var2
End Sub

Private Sub sub2
var
End Sub

Sub SetVar(v)
var2=v
End Sub
end class
Set cls = new MyClass' generates an object with set
("asd")
= 1
cls.sub1' is quite encapsulated, and it will not prompt that there is no permission. It directly says that it does not support attributes or methods.
%>