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.