ASP Class

Source: Internet
Author: User
Class declaration
Declaring a class name is to define some variables, attributes, and methods to form a class.
This is true !!!? You can use classes in VBScript !?!? I wonder if it can be used in ASP !? In this way, can I write ASP programs like objects ?! Just do it! Practice is the only criterion for testing truth. Do it yourself!
We often see descriptions of classes in other programming languages, such as PHP, VB, and C ++. This class description in VBScript is the first time I have heard of it, our daily work is website development. In this case, we have more or less experience, and we can also boast of being "professional". So I will share what I know about this new stuff. Let's take a look at the following code! (Window2000 + IIS5.0 passed the test)
''Declares a class named aspcn.
Class aspcn
Private aspcn
''Initialization class
Private Sub Class_Initialize
Aspcn = "Aspcn Is Good! <Br>"
End Sub
''Defines a function
Public Function DoIt ()
DoIt = aspcn
End Function
''Defines a method
Public Sub QueryStr (stat)
Response. write stat
End Sub
End Class
Set Hi_aspcn = New aspcn ''defines an aspcn object instance named Hi_aspcn.
Response. write Hi_aspcn.DoIt
Varstr = "Aspcn Is Cool! <Br> <font color = red> </font> <br> WelCome !!! "
Hi_aspcn.QueryStr varstr
This is a very simple program. We declare a class named aspcn in it, and create a DoIt function and a QueryStr method. This program is very simple for everyone to understand. Its display is as follows:
Aspcn Is Good!
Aspcn Is Cool!
WelCome !!!
You can write the commonly used programs into a class, and then use it <! -- # Include file = "xxx. asp" --> to include the file. This provides us with a new space for developing programs.
From: ID = 466

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.