So what does the basic structure and syntax of an ASP page look like? An ASP file appears to be very similar to that of a typical HTML file, with one exception. While an HTML file normally contains HTML elements, an ASP file will also contain server-side scripts, which are normally encapsulated by two special delimiters,
Server-side scripts are executed on the server, and not on the client browser. They can contain statements, procedures, and/or operators that are valid for the scripting language you define within your ASP page. If you do not declare a scripting language, VBScript is used as the default language.
<!DOCTYPE html> <html> <head> <title>Hello World!</title> </head> <body> <% response.write("Hello World!") %> </body> </html>
Another way to introduce server-side VBScript is to use the
<script> element. To instruct the web server to treat the code as server-side rather than client-side, you need to ensure that the
runat attribute is included.
<!DOCTYPE html> <html> <head> <title>Hello World!</title> </head> <body> <script language="vbscript" runat="server"> response.write("Hello World!") </script> </body> </html>