You are on page 1of 10

Output

<html>
<body>
<%
response.write("Hello World!")
%>
</body>
</html>
What is ASP?
• ASP stands for Active Server Pages
• ASP is a Microsoft Technology
• ASP is a program that runs inside IIS
• An ASP file is just the same as an HTML
file
• An ASP file can contain text, HTML, XML,
and scripts
• Scripts in an ASP file are executed on the
server
• An ASP file has the file extension ".asp"
Response Object
The ASP Response object is
used to send output to the user
from the server. Its collections,
properties, and methods are
described below:
Request Object
When a browser asks for a page from a
server, it is called a request.
<html>
<body>
<%
="Hello World!"
%>
</body>
</html>
VB Script Example
<html>
<body>
<script type="text/vbscript">
Function greeting()
If i < 10 Then
  document.write("Good morning!")
Else
  document.write("Have a nice day!")
End If
End Function
</script>
</head>
<body onload="greeting()">
</body>
</html>
Procedures

<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
<p>Result: <%call vbproc(3,4)%></p>
</body>
</html>
For Loop
<html>
<body>
<script type="text/vbscript">
For i = 0 To 5
  document.write("The number is " & i & "<br />")
Next
</script>
</body>
</html>

You might also like