Active Server Pages (ASP)

Definition and history

Active Server Pages (ASP) is an open application programming language environment (open application environment) to build serverside type web application (internet). Open application environment, meaning that the use of ASP, the pages of Hypertext Markup Language (HTML), scripts, and ActiveX components can be combined into one to build a web application.
HTML is a standard language for writing web documents can be displayed on the browser. The script is a small program snippet is pasted on a web document so that the web pages more interactive. While ActiveX is a set of technologies that enables software components to interact with each other in a connected environment regardless of what language the components are created.
ASP was created by Microsoft to address the challenges of a dynamic web programming, where the contents of a web site can be programmed to get different results. Unlike HTML that displays only static content, ASP can display different content pages in accordance with its programming goals. Until the time of writing, ASP has reached version 3.0 running on Windows platforms 2000 Professional or Server. Previous versions, namely version 2.0, can run on other platforms such as Linux, Solaris, OS / 2, and Novell. Currently Microsoft is designing the successor of ASP 3.0, the ASP + that runs on Windows. NET Framework.
ASP pure language of Object Oriented Programming (OOP). The structure of language is similar to Visual Basic language that is easily understood because the syntax using English. As is known, that Visual Basic is a programming language that is most easy to understand and learn than other programming languages. Therefore, ASP is easily learned by even beginners to create web applications, in addition to reliability and completeness of the facilities provided.
In order to program the web using ASP (Active Server Pages) There are several requirements that must be met. As the following illustration will explain two things to note, that is associated with the operating system. Because today there are several types of operating systems, then this book is explained in the application that uses ASP for Microsoft Windows operating systems and non-Microsoft Windows.

TERMS OF USE
In order to program the web using ASP (Active Server Pages) There are several requirements that must be met. As the following illustration will explain two things to note, that is associated with the operating system. Because today there are several types of operating systems, then this book is explained in the application that uses ASP for Microsoft Windows operating systems and non-Microsoft Windows.
– For Microsoft Windows Users
If you use Microsoft Windows there are several things that must be met to learn ASP. The absolute requirement must be met, because without complying with the requirements of the ASP program that builds will not work.
– Web Server
For those of you who use Microsoft Windows 98 if you will learn ASP (Active Server Pages) must be installed PSW (Personal Web Server) for Windows 98. Whereas when using Microsoft Windows NT, Windows 2000 or Windows XP IIS (Internet Information Server) must be installed already.
PWS contained in the Windows 98 CD in the Addons directory. IIS 4.0 on the CD NT Option Pack 4.0 for Windows NT 4.0, whereas IIS 5.0 or IIS version 5.1 has been wrapped into one in Microsoft Windows 2000 or Windows XP.
– Editor
Because ASP scripts are written in pure text form such as HTML, you can use any text editor to edit the ASP files, such as Notepad. You can also use the editor specifically designed to create HTML web pages and scripts such as MS FrontPage and Macromedia Dreamweaver. If you want to look more professional, you can use MS Visual Interdev, Microsoft made software that is specifically designed to create a web application (ASP). Microsoft Visual Interdev Microsoft Visual Studio including the family, a bundle with MS Visual Basic, C + +, Foxpro, and J + +.
– Browser
Browser is used to test the ASP script created. You can use any browser like Internet Explorer, Netscape Navigator, or Opera.
– For Non-Windows Users
Active Server Pages continues to grow and become popular among web developers. Limitations of the use intended only for the Windows platform to be problems for ASP development. Two companies have pioneered the manufacture of components to run ASP on various operating system platforms.
– Chili! ASP (http://www.chilisoft.com)
Provides a function to execute ASP scripts on Netscape web server, Apache, and Lotus Go as well as development tools.
– Instant ASP (http://www.halcyonsoft.com)
ASP script executes in nearly all web servers and all platforms, like Windows NT, Sun, Novell, AIX, Apple, OS / 2, and much more.

HOW ASP
ASP script that has been made, can not be directly executed on a computer using the browser. Therefore, the translation of ASP script requires a separate server. ASP scripts are processed on a web server, the results are then sent to the client in HTML format. Therefore web pages containing ASP can be opened by any browser because the output is displayed in the browser is an HTML document.
In Windows 2000, the library executioner ASP scripts is a default ASP.DLL installed in the directory WINNT \ System32 \ inetsrv. When there is a request from the client to open a page that contains the script ASP, IIS will be ordered to file to execute existing scripts. Once completed, the results were combined with existing HTML code to form a complete HTML document. Complete documents are then submitted to a web server to be forwarded to the client who requested it.
This type of script that is processed as an ASP script called serverside script. Different from the ASP VBScript scripts or JavaScript is processed and the results are viewed directly in the browser. Types such as VBScript and JavaScript script called clientside script.

ASP SCRIPT WRITING
ASP Script writing can be put on a web page in two ways:

Method 1
Language=”VBScript” <SCRIPT runat=”server”>

‘ASP script

</ SCRIPT>

Method 2
<%

‘ASP script

%>

VARIABLES IN ASP

Basically there is only one type of variables in the ASP, the variant. It’s just for ease of processing, the variables in ASP can be divided into five, namely: the object, string, numeric, date & time, and boolean.
Variable object is created when we want to program using special objects like Scripting.FileSystemObject object, the object CDONTS.NewMail, and others. String variable is a variable that contains the text, while the numeric variable is a variable that contains the numbers, both integers and fractions. Date time variable containing the date and time information, while the variable contains a value of type boolean logic True or False.

A variable
A variable in ASP is optional, ie can not be done. Declaration is normally used to facilitate the maintenance of the variables in the application. A variable can be made absolute, that is to be declared by adding the statement <% Option Explicit%> at the top of the program, before writing another ASP commands.
<%
Dim lGaji
Dim sPesan
Dim oConn, ORs
%>

Writing the description on the program carried out by first writing the sign ‘.
– The use of & and + operators
The operator & is used to connect the string, while the + operator is used to add numbers. Note the difference in the following example:
<%
A = 100
B = 50
C = A & B ‘C = “10 050”
D = A + B ‘D = 150
%>
– If-Then structure branching-Else
Example If-Then strktur branching-Else as follows.
<%
Age = 3
If Age <= 5 Then
Response.Write “There are still Toddlers’
Else
Response.Write “Not Toddlers Again”
End If
%>
will print: Toddler Still, for the variable Age value 3, which is smaller than 5.
– Select Case branching structure – End Select
<%
Value = “B”
Value Select Case
Case “A”
Response.Write “Excellent”
Case “B”
Response.Write “Good”
Case “C”
Response.Write “Enough”
Case “D”
Response.Write “Less”
Case “E”
Response.Write “Bad”
End Select
%>
will print: Good, because the value of the variable value B.
– For-Next Repetition Structure
<%
Dim I
For I = 1 To 5
Response.Write I & ”

Next
%>
will print:
1
2
3
4
5
with
HTML is a command line to change.
– Repetition Structure For Each – Next
Similar to the structure of the For-Next loop, it’s just that For Each – Next is used to retrieve elements from an array or object.
<%
Dim A (3)
A (1) = “Welcome”
A (2) = “Learning”
A (3) = “ASP 3.0″

For Each Item In A
Response.Write Item
Next
%>
will produce:
Happy Learning ASP 3.0
– Do-Loop Repetition Structure
Do-Loop loop structure is a structure that uses repetition as a condition of repetition condition.
<%
I = 1
Do
Response.Write I & ”

I = I + 1
Loop Until I = 5
%>
the results are exactly the same as the number 5.
– Creating Sub and Function Procedures
Sub is a discount program that performs a specific task to facilitate the identification and tracing of program flow. Function is a kind of sub that returns a value.
Example:
<%
Sub TulisJudul
Response.Write ”
Calculating Area of a Circle

End Sub

Function LuasLingkaran (jari2)
LuasLingkaran = 3.14 * jari2 * jari2
End Function

Dim R
R = 5

TulisJudul
Response.Write ”
Jari-Jari: “& R
Response.Write ”
Area of circle: “& LuasLingkaran (R)
%>
Splicing  Statement Too Long
To embellish the writing of statements that are too long and be easy to read, the writing can be continued using the sign _. For example:
If Age> 18 And Works <> “” And Status <> “Married” Then

End If
can be written as:
If Age> 18 And _
The work <> “” And _
Status <> “Married” Then

End If

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s