Haha, I saw someone on the Internet who has learned Asp for 10 days, and I also want to write one. Since he is called 10 days, I will only have 5 days. Haha, look at it more for beginners, experts point out mistakes, don’t joke about me! Know
Knowledge can only be developed with sharing, don’t be stingy with your knowledge! ! ! !
Okay, let’s talk less and start now!
First of all, I will talk about ASP first. Asp is the abbreviation of ActiveServerPages.
In order to facilitate understanding, we think of asp as a scripting language inserted into HTML, so it is convenient to understand.
The books all start with helloworld code, so let's start like this!
Here we will start with an example:
〈html〉
<title>helloworld</title>
<body>
<%response.write("helloworld")%>
</body>
</html>
Save it as test.asp, and you can see helloworld after debugging.
Here we will first let you see how it is inserted into HTML (the asp program is placed in the middle of "<%%>")
Of course, we can also output HTML tags in response.write, for example:
<%response.write"<fontsize=20color=red>Hello</font>"%>
You can see a red number 20 "Hello"
Next we will talk about
There are six built-in objects in Asp, namely:
Request: Responsible for receiving information from the user side
Response: Pass information to users
Server: Control the asp running environment
Session: Responsible for storing individual user information
Application: Responsible for storing data to provide usage by multiple users
objectcontext: It can provide an asp program to directly cooperate with MTS to disperse things
Among them, we commonly use: Request, Response, Server, Session, Application
In this article, we will talk about it one by one.
Just now, we used the Response write method among the six built-in objects to output helloworld
Let’s use an example to explain the usage of request and response:
First, we need to use the form tag of html to pass the value:
First, let’s make a form page first to enter data. This page is called login.asp
<html>
<title>Demonstration of request and response (passing and outputting values)</title>
<body>
<formname=form1action=checklogin.aspmethod=post>
<center>
<tablewith=500>
<tr>
<tdcolspan="2"align="center"><fontsize=5color=blue>User login portal</font>
</td>
</tr>
<tr>
<td><fontsize=2>Username:</font></td>