ASP is a server-side scripting environment for creating dynamic interactive Web server applications. In ASP Dynamic Web pages, not only can you include server-side scripting code, you can also use ASP to build objects and server components, and you can include server-side files.
First, add server-side scripts to ASP pages
A server script is a series of instructions used to issue commands to a Web server. To insert a server-side script into an ASP page, you first need to set the scripting language you use, with the following 3 ways to set up.
1), use @ LANGUAGE instruction
The @ LANGUAGE directive sets the language used to interpret script commands, with the following syntax format:
<%@ Language=脚本语言 %>
Attention
The @ Language directive must be placed in the first line of the document. There is a space between the "@" symbol and the keyword "Language".
2), the use of <Script> tag related properties
To include server-side scripts in your document, you can also use the Language property of the script tag to set all the scripting languages and use the Runat property to indicate that the script is running on the server side. For example:
<script language="VBScript" runat="server">
......
</script>
3), using the Internet information Services snap-in
You can use the Internet information Services snap-in to set the default scripting language for all ASP Dynamic Web pages that are installed on the Web service side. Here's an example of an XP system:
Select the start → program → manage →internet server command.
In the Internet Information Services snap-in window, select the default site. Right-click and select the Properties command to open the property sheet. On the Home Directory tab, click the Configure button. Click the Options tab, and in the Default ASP language box, enter the primary scripting language you want to use.
Simple example: Displays the 7 sizes of the font.
<%@ language=VBScript %>
<title>如何设置所使用的脚本语言</title>
<body>
<% for i=3 to 7 %>
<Font color="red" size=<%= i %>>
欢迎来闪客启航学习!<br>
</font>
<% next %>
</body>