Rules for ASP program syntax

Source: Internet
Author: User

In the browser by viewing the source code is not able to see the ASP source code, you can only see the ASP file
The result of the output, and those are just pure HTML. This is because, before the result is sent back to the browser, the script has been
Executed on the server.
In our ASP tutorial, each example provides hidden ASP code. This will make it easier for you to understand their
Working principle.
Instance:
Write text with ASP
If you are using ASP to generate text.
Add HTML to Text
If both HTML tags and plain text are generated. Basic ASP Syntax rules
Typically, an ASP file contains HTML tags, similar to HTML files. However, an ASP file can also contain a service
Server-side scripts, which are surrounded by <% and%>. Server scripts are executed on the server side and can contain legitimate
expression, statement, or operator.
Write output to the browser
The Response.Write command is used to write output to the browser. The following example sends a text to the browser: "Hello
World ".

<body>
<%
Response.Write ("Hello world!")
%>
</body>

<body>
<%= "Hello world!" %>
</body>

You can use a number of scripting languages in ASP. However, the default scripting language is VBScript:

<body>
<%
Response.Write ("Hello world!")
%>
</body>
Javascript
If you need to use JavaScript as the default scripting language for a particular page, you must insert it at the top of the page
One-line language setting: Changchun Kowloon Male Hospital
<%@ language= "JavaScript"%>

<body>
<%
Response.Write ("Hello world!")
%>
</body>
JavaScript requires the use of different uppercase and lowercase letters to write ASP code.
Tip: If you need more information about JavaScript, learn about our JavaScript tutorials.
Other scripting languages
The ASP's collaboration with VBScript and JScript is inherently original. If you need to write scripts in a different language than
such as PERL, REXX, or Python, you must install the appropriate scripting engine.
Important: Because scripts are executed on the server side, browsers that display ASP files do not need to support scripts at all.

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.