What is ASP syntax?

If you have any experience with PHP, JavaScript, or any general programming language, then ASP’s syntax will make some sense to you. However, if you only have experience with web technologies like HTML and CSS, then ASP will be a challenge for you.

ASP syntax: wrapper

Just like how HTML uses tags, ASP also needs tags to create dynamic websites. These tags do not resemble your typical HTML tags. Below is an ASP script that outputs “Hello World!” into HTML.

<% Response.Write("Hello World!") %>

ASP tags

The tags <% and %> will always encapsulate your ASP code. Scripts surrounded by these special tags are executed on the server ASP code and can occur anywhere, even within an HTML tag, as seen below.

<a href = "<% Response.Write("Contact.asp")%>">Contact Us </a>

The above code block, when run, will display “Contact Us”.

Script dependent

The rest of ASP’S syntax is dependent on which scripting language you are using in your ASP code. However, you can also use non-scripting languages.

<!Doctype html>
<html>
<body>
<%
Response.Write("Hello World!")
%>
</body>
</html>

Free Resources