ASP
Syntax
If you have any experience with
PHP, Javascript, or general
programming 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 more of a
challenge.
ASP Syntax: Wrappers
Just how HTML uses tags to
create web pages, ASP needs tags
to create dynamic web sites. These
tags do not resemble the typical
tags used in HTML, so be sure you
notice the difference between tags
used for ASP and tags used for
HTML. Below is the ASP script we
used in the previous lesson.
ASP Code:
<html>
<body>
<%
Response.Write("Hello Me")
%>
</body>
</html> |
ASP - Tags
These special tags <% and %>
will always encapsulate your ASP
code. Some things about the ASP
tag that sets it apart from normal
HTML tags:
- An opening ASP tag is <%
while an HTML tag normally looks
like <tagname>
- A closing ASP tag looks like
%> while an HTML tag normally
looks like </tagname>
- ASP code can occurr
anywhere, even within an HTML
tag opening tag like this:
ASP Code:
|
<a href="<%
Response.Write("index.asp")
%>">Home</a> |
Display:
|
|
|
|