0% found this document useful (0 votes)
17 views

ASP Introduction and Installation: What Does The ASP File Contain

ASP is a server-side scripting language used for executing scripts on a web server. An ASP file contains HTML tags and server-side scripts. When a client requests an ASP file, the server passes it to the ASP engine which executes the scripts and returns plain text to the browser.

Uploaded by

Neha Tyagi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

ASP Introduction and Installation: What Does The ASP File Contain

ASP is a server-side scripting language used for executing scripts on a web server. An ASP file contains HTML tags and server-side scripts. When a client requests an ASP file, the server passes it to the ASP engine which executes the scripts and returns plain text to the browser.

Uploaded by

Neha Tyagi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ASP Introduction and Installation

ASP stands for Active Server Page. It is commonly known as Classic ASP or ASP
Classic. ASP is a server-side scripting language that is used for executing the scripts on
the webserver. This technology was developed by Microsoft. It is an old but still useful
tool used to create dynamic webpages.
ASP is a program that runs inside a web server. Active Server Pages is a programming
environment that gives you the ability to generate interactive dynamic HTML pages with
the help of client-side and server-side scripting.
What does the ASP file contain:
An ASP file has an extension “.asp”. It is the same as HTML Files. An ASP file can
contain server scripts in addition to HTML Tags. In an ASP page, VB Script is usually
used as a server-side and JavaScript as the client scripting language.
Uses of ASP:
 It is used to get or retrieve the data from the form when the form will be submitted by
users. For example, you can have users submit their e-mail addresses to be added to a
mailing list.
 It is used to edit. Change and add more content to a webpage and create a customized
website.
 It is used to get and set the cookies from the web Browser.
 It is used to give responses to user queries.
 It is used to communicate with databases means to read data stored in a database or
write new data to a database.
 It is used to implement sessions. Basically, a session is a way to store information
about what happens during a user’s visit to a website. Through this mechanism, you’ll
be able to store information about the user like at what time they visited a page.
How does it work?
 When the web Browser requests an HTML File to the webserver then it will return
the file o the web browser.
 On the other hand. When the client requests an ASP file then the server passes over
the requests to the ASP engine.
 An ASP engine is used to read the ASP file Content and executing the server scripts.
 In the end. The file returns to the Browser as Plain text.
How to run ASP File?
1. Firstly download and install a setup on your computer.
 Press the Windows + R key and type appwiz.cpl in the Run box and press enter.
 Select “Turn Windows features on or off”

 Now click on the Internet Information Services check box and select sub-
components are given below. It will take some time after click OK.
 Go to your browser and navigate to localhost.
2. After Installation, Search for a new folder named “Inetpub” on the hard drive of your
PC.
3. Inside the “Inetpub” Folder, Open a new folder called”wwwroot.”.
C:\inetpub\wwwroot
4.Create a new folder named “Geeks” inside wwwroot.
5. Create a new file named “GFG.asp” inside Geeks Folder.
6. Write some ASP code and save the file as “GFG.asp”.
7. Now, check that your web server is running properly or not.
8.In the end, Open your browser and type “http://localhost/Geeks/GFG.asp”, to view
your first web page
Example: A Simple Hello world Program in ASP.
 ASP

<!DOCTYPE html>

<html>

<body>

<%

response.write("Hello World")

%>

</body>

</html>

Output:
Hello World
Explanation: This is a very basic example of a Classic ASP page that returns the phrase
“Hello World” to the browser along with the rest of the standard HTML. The HTML
portions are static, i.e. the server will send them to the browser as-is. The parts delimited
by <% %> are what the server will actually process before sending it to the client.

1.13 SAMPLE ASP.NET PROGRAM (Using TextBox, RadioButton, Button):

Aim : To choose sex of a candidate from radiobutton, Read age of the candidate from
a textbox and determine, whether the candidate is eligible for marriage.

<%@ Page Language="VB" CodeFile="Default.aspx.vb" %>


<html>
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Style="left: 296px; position:
absolute; top: 80px" Width="24px"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" Style="left: 160px; position:
absolute; top: 216px" Width="216px"> </asp:TextBox>
<asp:Label ID="Label1" runat="server" Style= "left: 264px; position: absolute;
top: 80px" Text="Age"> </asp:Label>
<asp:Label ID="Label2" runat="server" Style= "left: 8px; position: absolute;
top: 80px" Text="Sex"> </asp:Label>
<asp:RadioButton ID="RadioButton1" runat="server" Style="left:
0px; position: absolute; top: 112px" Text="Male" />
<asp:RadioButton ID="RadioButton2" runat="server" Style="left:
0px; position: absolute; top: 144px" Text="Female" />
<asp:Button ID="Button1" runat="server" Style="left: 88px; position:
absolute;top: 216px" Text="CHECK" />
</div>
</form>
</body>
</html>

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True And Val(TextBox1.Text) > 24 Then
TextBox2.Text = "ELIGIBLE FOR MARRIAGE"
Else
TextBox2.Text = "NOT ELIGIBLE FOR MARRIAGE"
End If
If RadioButton2.Checked = True And Val(TextBox1.Text) > 21 Then
TextBox2.Text = "ELIGIBLE FOR MARRIAGE"
Else
TextBox2.Text = "NOT ELIGIBLE FOR MARRIAGE"
End If
RadioButton1.Checked = False
RadioButton2.Checked = False
End Sub

You might also like