Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i Am trying To Create A Class In Classic Asp But Getting Error AS


"Microsoft VBScript compilation error '800a03f2'

Expected identifier

/HtmlPage.asp, line 2

Public Class Application1
-------^"

What I have tried:

<%
Public Class Application1
Public msg
Public Function ShowMessage() As String
ShowMessage = "Hello!!!"
End Function
End Class
%>
<%
Dim myclass
Set myclass = new Application1
response.Write(myclass.ShowMessage())
%>
Posted
Updated 15-May-19 5:04am
Comments
alezxxx 15-May-19 11:25am    
eliminar Public Class Application1 -> Class Application1

Public Function ShowMessage() As String <-- eliminar As String

1 solution

I believe Public is your problem. See Object Oriented ASP: Using Classes in Classic ASP[^] for a good walkthrough on using classes in ASP.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900