SlideShare a Scribd company logo
1 of 26
Active Server Page (ASP)
Presented By
Keshab Nath
Introduction to ASP
• What is ASP?
– ASP stands for Active Server Pages.
– ASP is a program that runs inside IIS.
– IIS stands for Internet Information Services.
– ASP is Microsoft’s solution to building advanced Web sites.
Processing of an HTML Page
RequestBrowser Web Server
Memory-HTML fileHTML File
When a browser requests an HTML file, the server returns the file
Processing of an ASP Page
RequestBrowser Web Server
Memory-ASP FileHTML File Processing
When a browser requests an ASP file, IIS passes the request to the
ASP engine. The ASP engine reads the ASP file, line by line, and
executes the scripts in the file. Finally, the ASP file is returned to the
browser as plain HTML.
Introduction to ASP
ASP page can consists of the following:
– HTML tags.
– Scripting Language (JavaScript/VBScript).
– ASP Built-In Objects.
– ActiveX Components eg. : ADO – ActiveX Data
Objects.
So, ASP is a standard HTML file with extended
additional features.
ASP Syntax
– An ASP file normally contains HTML tags, just as a
standard HTML file.
– In addition, an ASP file can contain server side
scripts, surrounded by the delimiters <% and %>.
Server side scripts are executed on the server, and
can contain any expressions, statements, procedures,
or operators that are valid for the scripting language
you use.
– The response.write command is used to write output to
a browser
ASP Syntax
• Scripts
– Script is nothing but a set of commands that are
written to perform a specific task
– These commands are VBScript or JavaScript
commands
– There are two types of Scripts:
• Client-Side Script : Runs On Browser (default : JavaScript)
• Server-Side Script : Runs On Server (default : VBScript)
– Scripts in an ASP file are executed on the server.
ASP Syntax
Scripts
– Client-Side Script is embedded into the HTML file using
tags:
<script language=“JavaScript/VbScript”>
{JavaScript/Vbscript Code}
</script>
– Server-Side Script is embedded into the ASP file using tags:
<script language=Vbscript/JavaScript
RunAt=SERVER>
{Vbscript/JavaScript Code}
</Script>
OR
<%@ Language = “VBScript/JavaScript” %>
<% {VBScript/JavaScript Code} %>
Example
<html>
<body>
<%
response.write("Hello World!")
%>
</body>
</html>
ASP Variables
• Variables
– Variables are used to store information
– This example demonstrates how to create a variable,
assign a value to it, and insert the variable value into a
text.
<html>
<body>
<%
Dim name
name=“Tripti Arora"
Response.Write("My name is: " & name)
%>
</body>
</html>
ASP Variables
• Arrays
– Arrays are used to store a series of related data items.
– This example demonstrates how you can make an array
that stores names.
<%
Dim name(5)
name(0) = "Jan Egil"
name(1) = "Tove"
name(2) = "Hege"
name(3) = "Stale"
name(4) = "Kai Jim"
name(5) = "Borge"
For i = 0 to 5
Response.Write(name(i) & "<br />")
Next
%>
</body>
</html>
Including Files
• The #include Directive
– It is possible to insert the content of another file
into an ASP file before the server executes it, with
the server side #include directive.
– The #include directive is used to create functions,
headers, footers, or elements that will be reused on
multiple pages.
Including Files
• How to Use the #include Directive
– Here is a file called "mypage.asp":
<html>
<body>
<h3>Words of Wisdom:</h3>
<p><!--#include file="wisdom.inc"--></p>
<h3>The time is:</h3>
<p><!--#include file="time.inc"--></p>
</body>
</html>
– Here is the "wisdom.inc" file:
"One should never increase, beyond what is necessary,
the number of entities required to explain anything."
– Here is the "time.inc" file:
<%
Response.Write(Time)
%>
<!-- #include virtual="somefilename“ - ->
Or
<!--#include file ="somefilename"-->
Syntax
Including Files
• Source code in a browser, it will look something
like this:
<html>
<body>
<h3>Words of Wisdom:</h3>
<p>"One should never increase, beyond what
is necessary, the number of entities
required to explain anything."</p>
<h3>The time is:</h3>
<p>11:33:42 AM</p>
</body>
</html>
ASP Forms and User Input
• User Input
– To get information from forms, you can use the
Request Object
– Example
<form method="GET" action="tizagGet.asp">
FirstName <input type="text" name=“fname"/>
LastName <input type="text" name=“lname"/>
<input type="submit" />
</form>
– There are two ways to get form information: The
Request.QueryString command and the
Request.Form command.
• Request.QueryString
– This collection is used to retrieve the values of the
variables in the HTTP query string.
– The form data we want resides within the Request
Object's QueryString collection
– Information sent from a form with the GET method is
visible to everybody (in the address field) and the GET
method limits the amount of information to send.
– If a user typed “Bill" and "Gates" in the form example
above, the url sent to the server would look like this:
http://www.asp.com/pg.asp?
fname=Bill&lname=Gates
Request Object - Collections
Request Object - Collections
Request.QueryString
– The ASP file "pg.asp" contains the following script:
<body>
Welcome
<%
response.write(request.querystring
("fname"))
response.write(request.querystring
("lname"))
%>
</body>
– The example above writes this into the body of a
document:
Welcome Bill Gates
Request Object - Collections
• Request.Form
– It is used to retrieve the values of form elements
posted to the HTTP request body, using the POST
method of the <Form> Tag.
– Information sent from a form with the POST method
is invisible to others.
– The POST method has no limits, you can send a large
amount of information.
– If a user typed "Bill" and "Gates" in the form example
above, the url sent to the server would look like this:
http://www.asp.com/pg.asp
Request Object - Collections
• Request.Form
– The ASP file "pg.asp" contains the following script:
<body>
Welcome
<%
response.write(request.form("fname"))
response.write("&nbsp;")
response.write(request.form("lname"))
%>
</body>
– The example above writes this into the body of a
document:
Welcome Bill Gates
ASP Session
• The Session Object
– The Session object is used to store information
about each user entering the Web-Site and are
available to all pages in one application.
– Common information stored in session variables
are user’s name, id, and preferences.
– The server creates a new Session object for each
new user, and destroys the Session object when
the session expires or is abandoned or the user
logs out.
ASP Session
• Store and Retrieve Variable Values
– The most important thing about the Session
object is that you can store variables in it, like this:
<%
Session("TimeVisited") = Time()
Response.Write("You visited this site at:
"&Session("TimeVisited"))
%>
Here we are creating two things actually: a key and a value. Above
we created the key "TimeVisited" which we assigned the value
returned by the Time() function.
Display:
You visited this site at: 8:26:38 AM
Session Object - Properties
• SessionID
– The SessionID property is a unique identifier that is
generated by the server when the session is first
created and persists throughout the time the user
remains at your web site.
– Syntax:
<%Session.SessionID%>
Example:
<% Dim mySessionID
mySessionID = Session.SessionID
%>
ASP Cookies
• Like ASP Sessions, ASP Cookies are used to store information
specific to a visitor of your website. This cookie is stored to
the user's computer for an extended amount of time. If you set
the expiration date of the cookie for some day in the future it
will remain their until that day unless manually deleted by the
user.
• Creating an ASP cookie is exactly the same process as
creating an ASP Session. We must create a key/value pair
where the key will be the name of our "created cookie". The
created cookie will store the value which contains the actual
data.
Create Cookies
<%
'create the cookie
Response.Cookies("brownies") = 13
%>
To get the information we have stored in the cookie we
must use the ASP Request Object that provides a nice
method for retrieving cookies we have stored on the
user's computer.
Retrieving Cookies
<%
Dim myBrownie
'get the cookie
myBrownie = Request.Cookies("brownies")
Response.Write("You ate " & myBrownie & "
brownies")
%>
• Display:
You ate 13 brownies
THANK YOU

More Related Content

What's hot (20)

Id and class selector
Id and class selectorId and class selector
Id and class selector
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
Php array
Php arrayPhp array
Php array
 
Simple object access protocol(soap )
Simple object access protocol(soap )Simple object access protocol(soap )
Simple object access protocol(soap )
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
Client side scripting and server side scripting
Client side scripting and server side scriptingClient side scripting and server side scripting
Client side scripting and server side scripting
 
Asp net
Asp netAsp net
Asp net
 
Css
CssCss
Css
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Active server pages
Active server pagesActive server pages
Active server pages
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 

Viewers also liked

Introduction ASP
Introduction ASPIntroduction ASP
Introduction ASPFaTin GhaZmi
 
Active server pages
Active server pagesActive server pages
Active server pagesstudent
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance JavaDarshit Metaliya
 
Active x control
Active x controlActive x control
Active x controlAmandeep Kaur
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMAashish Jain
 

Viewers also liked (10)

Introduction ASP
Introduction ASPIntroduction ASP
Introduction ASP
 
ASP
ASPASP
ASP
 
Asp objects
Asp objectsAsp objects
Asp objects
 
Active server pages
Active server pagesActive server pages
Active server pages
 
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
 
Active x
Active xActive x
Active x
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
 
Active x control
Active x controlActive x control
Active x control
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
Jsp element
Jsp elementJsp element
Jsp element
 

Similar to Active Server Page(ASP)

DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)Prof Ansari
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netshan km
 
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALAACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALASaikiran Panjala
 
Web server
Web serverWeb server
Web serverSajan Sahu
 
Intro To Asp
Intro To AspIntro To Asp
Intro To AspAdil Jafri
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaJignesh Aakoliya
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answerssonia merchant
 
Top 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answersTop 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answersPooja Gaikwad
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizationsAnup Hariharan Nair
 
Opr089 xx
Opr089 xxOpr089 xx
Opr089 xxTobie Tlm
 
Introducing asp
Introducing aspIntroducing asp
Introducing aspaspnet123
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while savingmdc11
 
Programming languages asp.net
Programming languages asp.netProgramming languages asp.net
Programming languages asp.netVasilios Kuznos
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architectureIblesoft
 
Asp.net w3schools
Asp.net w3schoolsAsp.net w3schools
Asp.net w3schoolsArjun Shanka
 

Similar to Active Server Page(ASP) (20)

ASP
ASPASP
ASP
 
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
asp_intro.pptx
asp_intro.pptxasp_intro.pptx
asp_intro.pptx
 
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALAACTIVE SERVER PAGES BY SAIKIRAN PANJALA
ACTIVE SERVER PAGES BY SAIKIRAN PANJALA
 
Web server
Web serverWeb server
Web server
 
Intro To Asp
Intro To AspIntro To Asp
Intro To Asp
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
 
Top 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answersTop 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answers
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Opr089 xx
Opr089 xxOpr089 xx
Opr089 xx
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
 
Programming languages asp.net
Programming languages asp.netProgramming languages asp.net
Programming languages asp.net
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
Asp.net w3schools
Asp.net w3schoolsAsp.net w3schools
Asp.net w3schools
 
Asp.net
Asp.netAsp.net
Asp.net
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 

More from Keshab Nath

Grid computing
Grid computingGrid computing
Grid computingKeshab Nath
 
J2 ee container & components
J2 ee container & componentsJ2 ee container & components
J2 ee container & componentsKeshab Nath
 
Distributed computing
Distributed computingDistributed computing
Distributed computingKeshab Nath
 
IP Security
IP SecurityIP Security
IP SecurityKeshab Nath
 
Cyber crime and cyber security
Cyber crime and cyber  securityCyber crime and cyber  security
Cyber crime and cyber securityKeshab Nath
 

More from Keshab Nath (6)

Grid computing
Grid computingGrid computing
Grid computing
 
J2 ee container & components
J2 ee container & componentsJ2 ee container & components
J2 ee container & components
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
IP Security
IP SecurityIP Security
IP Security
 
Cyber crime and cyber security
Cyber crime and cyber  securityCyber crime and cyber  security
Cyber crime and cyber security
 
Cyber law
Cyber lawCyber law
Cyber law
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
 

Active Server Page(ASP)

  • 1. Active Server Page (ASP) Presented By Keshab Nath
  • 2. Introduction to ASP • What is ASP? – ASP stands for Active Server Pages. – ASP is a program that runs inside IIS. – IIS stands for Internet Information Services. – ASP is Microsoft’s solution to building advanced Web sites.
  • 3. Processing of an HTML Page RequestBrowser Web Server Memory-HTML fileHTML File When a browser requests an HTML file, the server returns the file
  • 4. Processing of an ASP Page RequestBrowser Web Server Memory-ASP FileHTML File Processing When a browser requests an ASP file, IIS passes the request to the ASP engine. The ASP engine reads the ASP file, line by line, and executes the scripts in the file. Finally, the ASP file is returned to the browser as plain HTML.
  • 5. Introduction to ASP ASP page can consists of the following: – HTML tags. – Scripting Language (JavaScript/VBScript). – ASP Built-In Objects. – ActiveX Components eg. : ADO – ActiveX Data Objects. So, ASP is a standard HTML file with extended additional features.
  • 6. ASP Syntax – An ASP file normally contains HTML tags, just as a standard HTML file. – In addition, an ASP file can contain server side scripts, surrounded by the delimiters <% and %>. Server side scripts are executed on the server, and can contain any expressions, statements, procedures, or operators that are valid for the scripting language you use. – The response.write command is used to write output to a browser
  • 7. ASP Syntax • Scripts – Script is nothing but a set of commands that are written to perform a specific task – These commands are VBScript or JavaScript commands – There are two types of Scripts: • Client-Side Script : Runs On Browser (default : JavaScript) • Server-Side Script : Runs On Server (default : VBScript) – Scripts in an ASP file are executed on the server.
  • 8. ASP Syntax Scripts – Client-Side Script is embedded into the HTML file using tags: <script language=“JavaScript/VbScript”> {JavaScript/Vbscript Code} </script> – Server-Side Script is embedded into the ASP file using tags: <script language=Vbscript/JavaScript RunAt=SERVER> {Vbscript/JavaScript Code} </Script> OR <%@ Language = “VBScript/JavaScript” %> <% {VBScript/JavaScript Code} %>
  • 10. ASP Variables • Variables – Variables are used to store information – This example demonstrates how to create a variable, assign a value to it, and insert the variable value into a text. <html> <body> <% Dim name name=“Tripti Arora" Response.Write("My name is: " & name) %> </body> </html>
  • 11. ASP Variables • Arrays – Arrays are used to store a series of related data items. – This example demonstrates how you can make an array that stores names. <% Dim name(5) name(0) = "Jan Egil" name(1) = "Tove" name(2) = "Hege" name(3) = "Stale" name(4) = "Kai Jim" name(5) = "Borge" For i = 0 to 5 Response.Write(name(i) & "<br />") Next %> </body> </html>
  • 12. Including Files • The #include Directive – It is possible to insert the content of another file into an ASP file before the server executes it, with the server side #include directive. – The #include directive is used to create functions, headers, footers, or elements that will be reused on multiple pages.
  • 13. Including Files • How to Use the #include Directive – Here is a file called "mypage.asp": <html> <body> <h3>Words of Wisdom:</h3> <p><!--#include file="wisdom.inc"--></p> <h3>The time is:</h3> <p><!--#include file="time.inc"--></p> </body> </html> – Here is the "wisdom.inc" file: "One should never increase, beyond what is necessary, the number of entities required to explain anything." – Here is the "time.inc" file: <% Response.Write(Time) %> <!-- #include virtual="somefilename“ - -> Or <!--#include file ="somefilename"--> Syntax
  • 14. Including Files • Source code in a browser, it will look something like this: <html> <body> <h3>Words of Wisdom:</h3> <p>"One should never increase, beyond what is necessary, the number of entities required to explain anything."</p> <h3>The time is:</h3> <p>11:33:42 AM</p> </body> </html>
  • 15. ASP Forms and User Input • User Input – To get information from forms, you can use the Request Object – Example <form method="GET" action="tizagGet.asp"> FirstName <input type="text" name=“fname"/> LastName <input type="text" name=“lname"/> <input type="submit" /> </form> – There are two ways to get form information: The Request.QueryString command and the Request.Form command.
  • 16. • Request.QueryString – This collection is used to retrieve the values of the variables in the HTTP query string. – The form data we want resides within the Request Object's QueryString collection – Information sent from a form with the GET method is visible to everybody (in the address field) and the GET method limits the amount of information to send. – If a user typed “Bill" and "Gates" in the form example above, the url sent to the server would look like this: http://www.asp.com/pg.asp? fname=Bill&lname=Gates Request Object - Collections
  • 17. Request Object - Collections Request.QueryString – The ASP file "pg.asp" contains the following script: <body> Welcome <% response.write(request.querystring ("fname")) response.write(request.querystring ("lname")) %> </body> – The example above writes this into the body of a document: Welcome Bill Gates
  • 18. Request Object - Collections • Request.Form – It is used to retrieve the values of form elements posted to the HTTP request body, using the POST method of the <Form> Tag. – Information sent from a form with the POST method is invisible to others. – The POST method has no limits, you can send a large amount of information. – If a user typed "Bill" and "Gates" in the form example above, the url sent to the server would look like this: http://www.asp.com/pg.asp
  • 19. Request Object - Collections • Request.Form – The ASP file "pg.asp" contains the following script: <body> Welcome <% response.write(request.form("fname")) response.write("&nbsp;") response.write(request.form("lname")) %> </body> – The example above writes this into the body of a document: Welcome Bill Gates
  • 20. ASP Session • The Session Object – The Session object is used to store information about each user entering the Web-Site and are available to all pages in one application. – Common information stored in session variables are user’s name, id, and preferences. – The server creates a new Session object for each new user, and destroys the Session object when the session expires or is abandoned or the user logs out.
  • 21. ASP Session • Store and Retrieve Variable Values – The most important thing about the Session object is that you can store variables in it, like this: <% Session("TimeVisited") = Time() Response.Write("You visited this site at: "&Session("TimeVisited")) %> Here we are creating two things actually: a key and a value. Above we created the key "TimeVisited" which we assigned the value returned by the Time() function. Display: You visited this site at: 8:26:38 AM
  • 22. Session Object - Properties • SessionID – The SessionID property is a unique identifier that is generated by the server when the session is first created and persists throughout the time the user remains at your web site. – Syntax: <%Session.SessionID%> Example: <% Dim mySessionID mySessionID = Session.SessionID %>
  • 23. ASP Cookies • Like ASP Sessions, ASP Cookies are used to store information specific to a visitor of your website. This cookie is stored to the user's computer for an extended amount of time. If you set the expiration date of the cookie for some day in the future it will remain their until that day unless manually deleted by the user. • Creating an ASP cookie is exactly the same process as creating an ASP Session. We must create a key/value pair where the key will be the name of our "created cookie". The created cookie will store the value which contains the actual data.
  • 24. Create Cookies <% 'create the cookie Response.Cookies("brownies") = 13 %> To get the information we have stored in the cookie we must use the ASP Request Object that provides a nice method for retrieving cookies we have stored on the user's computer.
  • 25. Retrieving Cookies <% Dim myBrownie 'get the cookie myBrownie = Request.Cookies("brownies") Response.Write("You ate " & myBrownie & " brownies") %> • Display: You ate 13 brownies

Editor's Notes

  1. Steps involved in HTML page Processing are: A user enters request for Web Page in browser. The browser sends the request for the web page to web server such as IIS. The web server receives the request and recognizes that the request is for an HTML file by examining the extension of the requested file (.Html or .htm ) The Web Server retrieves the proper HTML file from disk or memory and sends the file back to the browser. The HTML file is interpreted by the user’s browser and the results are displayed in the browser window.
  2. ASP page processing Steps: A user enters request for Web Page in browser. The browser sends the request for the web page to web server such as IIS. The web server receives the request and recognizes that the request is for an ASP file by examining the extension of the requested file (.asp) The Web Server retrieves the proper ASP file from disk or memory. The Web Server sends the file to a special program named ASP.dll The ASP file is processed from top to bottom and converted to a Standard HTML file by ASP.dll. The HTML file is sent back to the browser. The HTML file is interpreted by the user’s browser and the results are displayed in the browser window.
  3. Client-side script runs on the Web Browser where Server-Side Script runs on the Web Server(in ASP file)
  4. Output: My name is: Tripti Arora
  5. Output:   Jan Egil Tove Hege Stale Kai Jim Borge
  6. The example will set the Session variable username to Tripti and the Session variable age to 24. The line returns: &quot;Welcome Tripti&quot;.