Programs | scripts
In the browser by looking at the source code can not see the ASP source code, you can only see the output from the ASP file, and those are just pure HTML. This is because the script is already executing on the server before the result is sent back to the browser.
Instance:
-
Write text in ASP
<%response.write("Hello World!")%> </body>
-
Add HTML to Text
<%response.write(" <%response.write("<p style='color:#0000ff'>This text is styled with the style attribute!</p>")%>
</body>
Basic ASP Syntax rules
Typically, ASP files also contain HTML tags, similar to HTML files. However, ASP files can also contain server-side scripts that are surrounded by <% and%>. Server scripts are executed on the server side and can contain legitimate expressions, declarations, or operators.
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".
<%response.write("Hello World!")%> </body>
There is also a shorthand method for Response.Write commands. The following example is equivalent to the above example:
<%="Hello World!"%> </body>
VBScript
You can use a number of scripting languages in ASP. However, the default scripting language is VBScript:
<%response.write("Hello World!")%> </body>
The example above also writes the text "Hello world!" in the body part of the document.
Javascript
If you need to use JavaScript as the default scripting language for a particular page, you must insert a line of language settings at the top of the page:
<%@ language= "javascript"%><%Response.Write("Hello World!")%> </body>
Note: Unlike VBScript-JavaScript is case sensitive. So you need to use different uppercase and lowercase letters to write ASP code according to the needs of JavaScript.
Other scripting languages
The ASP's collaboration with VBScript and JScript is inherently original. If you need to write scripts in other languages, such as Perl, REXX, or Python, then you must install the appropriate footstep engine.
Important: Because scripts are executed on the server side, browsers that display ASP files do not need to support scripting at all.