New Technologies and What They Mean To You: Part 2 - ASP
(Page 3 of 5 )
Definition ASP (Active Server Pages) is a Microsoft-developed, HTML-embedded, server-side scripting language used to create web pages.
ASP is a "framework" development environment, inside which you can invoke ASP properties and methods using the ASP-enabled language of your choice. Currently the 2 primary languages are Jscript (Microsoft's JavaScript-like language) and VBScript, both by Microsoft. ASP is designed to run on Microsoft's Internet Information Services web server, although it can run in other environments as well.
What It Really Is ASP is often the "non-developer's choice". It was designed for, and is highly geared towards those who have never scripted before. It allows for complex operations, while appearing relatively simple. There are no semi-colons to finish lines, and no curly braces to tell the ASP interpreter to start a control loop. It is kept simple, and yet is incredibly powerful, especially inside a Microsoft environment.
ASP's realm really is web-based development. Whether you require a simple guestbook, or a complex eCommerce application, ASP is more than capable of handling it. With standard functions such as connecting to databases, retrieving user and server information and extensions which allow uploading, image mapping, etc, it is easy to see why ASP is one of the most popular web scripting languages.
Advantages - Ease of learning for non-developers
- Integration with existing Microsoft products
- Ease of extension via COM objects
- Comes free with most Windows operating systems
- Developed by Microsoft
Disadvantages - Standard PHP functionality such as file uploading isn't present
- Strongest in a Windows environment, weaker on Unix or other platforms
- Developed by Microsoft
Examples The ASP documentation is available online at
http://msdn.microsoft.com Simple If/Else:
<%
a=0
if a=0 then
response.write "a is 0"
else
response.write "a is not 0"
end if
%> Comparison Operators:
a = b Checks if the value held in $a is the same as that held in $b
Not a = b Checks if the value held in $a is not equal to that held in $b
A < b Returns true if the value held in $a is LESS THAN that held in $b
A > b Returns true if the value held in $a is GREATER THAN that held in
Write out "1, 2, 3, 4, 5, 6, 7, 8, 9, 10" <%
For I=0 to 10
If I < 10 then
Response.write I & ", "
Else
Response.write I
End if
Next
%> SQL Server Database Connection <%
Set objConn = Server.CreateObject("ADODB.Connection"
ObjConn.Open "Provider=SQLOLEDB; SERVER=YOURSERVER; Database=YOURDATABASE; uid=username; password=password"
%> Similar Technologies Just about all web-based scripting languages are very similar. They fulfill the same purpose, however here are the most common:
- PHP: PHP is an Open Source C-based scripting language. It is very powerful, fast, and has an amazing user community.
- CFM: Cold Fusion is a Macromedia technology that makes development simple by relying on HTML-like tags to program your sites.
- JSP: Java Server Pages employ the power of Java for the web. They tend to be slightly slower than other languages, but with the power of Java behind them, end up being extremely robust.
Links Finding the right ASP resource amidst 400,000 sites can be daunting at times. Here are some topical resources to help you out:
DevArticles ASP Section LearnASP ASP Programmers resource ASP Documentation ASP documentation is available with every full install of Microsoft Internet Information Server. It is viewable through http://localhost/iishelp if it is installed. If not, check your installation options.
Next: ColdFusion >>
More ASP Articles
More By Jeremy Wright