ASP notation:
Notation 1:<%= "Hello world!" %>
Notation 2:<%
Response.Write ("Hello world!")
%>
ASP declaring variables: Using Dim
As follows:
<body>
<%
Dim name
Name = "Xiaohong"
Response.Write ("Your name is:" +name & "<br/>")
%>
</body>
ASP declaration Array: Dim arrayname (Arraylength)
<body>
<%
Dim names (3), I
Names (0) = "Zero"
Names (1) = "One"
Names (2) = "both"
Names (3) = "three"
For I=0 to 3
Response.Write ("Names is:" +names (i) & "<br/>")
Next
%>
ASP uses loops:
<body>
<%
Dim j
For J=1 to 6
Response.Write ("
Next
%>
ASP uses JavaScript scripts:
The first thing to write is the head:<%@ language= "javascript"%>
Using JavaScript, you can not use the relevant syntax of ASP, you should use JavaScript syntax
And JavaScript is to be case-sensitive
<%@ language= "JavaScript"%>
Note: Using the <%@ language= "JavaScript"%>, you can only use JavaScript syntax rules
Calling JavaScript-written functions
Write JavaScript functions in the head section: <% function%>
Write the call statement in the body section
As follows:
<%@ language= "javascript"%>
Two: To describe language as JavaScript in the script tag
runat= "Server"
Note: In this way, you can write JavaScript code that uses the syntax of ASP in the body
ASP processing forms:
Note: The HTML file is opened from IIS and the index.html file is placed at the top of the default file.
the value of the action is: ASP file
The value of method has get and post
If you use GET, use Request.QueryString (formname) to get the value
If you use post, use Request.Form (formname) to get the value
For example:
HTML file:
ASP Files: