Asp Syntax

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:Home

No comments:

Post a Comment