Getting Started with ASP class

Source: Internet
Author: User
Tags define include vbscript class
Class Declaration

Declaring the name of a class is defining variables, attributes, and methods to form a class

It's true!!!? Can I use class!?! in VBScript? Do not know can be used for asp!? In this way, I am not able to write an object like the ASP program?! Do what you say! Practice is the only standard to test truth, do it yourself!

We often see other programming languages have classes in the description, php,vb,c++, this in VBScript class description, I was the first time to hear, our daily work is the website development, in this more or less to make some experience, can also boast as "expert", So I'm going to share what I know about this new stuff. Let's take a look at the code below! (window2000+iis5.0 passed the test)

<%
"Declares a class named ASPCN
Class ASPCN
Private ASPCN
' Initialize class
Private Sub Class_Initialize
Aspcn= "ASPCN is good!<br>"
End Sub
"Define a function
Public Function DoIt ()
Doit=aspcn
End Function
"Define a method
Public Sub QUERYSTR (STAT)
Response.Write Stat
End Sub

End Class

Set hi_aspcn=new ASPCN ' defines an instance of a Aspcn object named HI_ASPCN
Response.Write HI_ASPCN. DoIt
Varstr= "ASPCN is Cool!<br><font color=red>http://www.aspcn.com</font><br>welcome!!!"
HI_ASPCN. Querystr Varstr

%>


This is a very simple program, in which we declare a class named ASPCN, set up a doit function, a querystr method, which is very simple to believe that you can read, it shows as follows:

ASPCN is good!
ASPCN is cool!
Http://www.aspcn.com
WelCome!!!

We can write a class of the program we use, and then we'll use <! --#include file= "xxx.asp"--> to include, which gives us a new space to develop the program

Turn from: http://goaler.xicp.net/ShowLog.asp?ID=466




Related Article

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.