Download - Web Design & Programming
![Page 1: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/1.jpg)
Web Design & Programming
ASPMr. Baha & Dr.Husam Osta
2014
![Page 2: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/2.jpg)
Outlines What is ASP? Internet Information Services How Does ASP Differ from HTML? What can ASP do for you? ASP Basic Syntax Rules
……..
![Page 3: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/3.jpg)
What is ASP? ASP stands for Active Server Pages ,or classical ASP
◦ ASP is Microsoft's first server side scripting engine ◦ It enables you to make dynamic and interactive web pages.◦ ASP is a program that runs inside
Internet Information Services (IIS)
An ASP file can contain ◦ Text, HTML, XML, and scripts
Scripts in an ASP file are executed on the server The default scripting language used for ASP is VBScript, or
others like JScript◦ An ASP file has the file extension “.asp”
![Page 4: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/4.jpg)
Internet Information Services (IIS)
Internet Information Services is an extensible web server created by Microsoft for use with Windows family.
IIS supports:◦ HTTP, HTTPS, FTP, FTPS, SMTP and NNTP.
It is an integral part of Windows family since Windows NT 4.0, though it may be absent from some edition (e.g. Windows XP Home edition).
IIS is not turned on by default when Windows is installed.
![Page 5: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/5.jpg)
How Does ASP Differ from HTML?
When a browser requests an HTML file1. the server returns the file
![Page 6: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/6.jpg)
How Does ASP Differ from HTML? When a browser requests an ASP file
1. IIS passes the request to the ASP engine. 2. The ASP engine reads the ASP file, line by line,
and executes the scripts in the file. 3. Finally, the ASP file is returned to the browser as
plain HTML
![Page 7: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/7.jpg)
What can ASP do for you?1. Dynamically edit, change, or add any content of
a Web page2. Respond to user queries or data submitted from
HTML forms3. Access any data or databases and return the
results to a browser4. Customize a Web page to make it more useful
for individual users
![Page 8: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/8.jpg)
Advantages of ASP …
1. The advantages over other technologies, are 1. Simplicity2. speed
2. Provide security since the code cannot be viewed from the browser
3. Clever ASP programming can minimize the network traffic
![Page 9: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/9.jpg)
ASP.Net Technology It is a unified Web development model It includes services necessary to build
enterprise-class web applications with minimum of coding.
This technology is developed under the .Net framework that is provided in the visual studio platform
![Page 10: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/10.jpg)
ASP Basic Syntax Rules An ASP file normally contains HTML tags, just like an
HTML file. An ASP file can also contain server scripts,
surrounded by the delimiters <% and %>. The command response.write is used to write output
to a browser.
Example<html>
<body><% response.write(“My first ASP script!”) %></body>
</html>
![Page 11: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/11.jpg)
Your first ASP page
ASP
HLTML
![Page 12: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/12.jpg)
Working with time and dates
![Page 13: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/13.jpg)
FormatDateTime(Date[, NamedFormat]) The NamedFormat argument may take the
following values:◦ vbLongDate◦ vbShortDate◦ vbLongTime◦ vbShortTime
Formatting time and dates
![Page 14: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/14.jpg)
YearReturns the current year from a date - with today's date, it returns: 2014
MonthReturns the current month from a date - with today's date, it returns: 1
DayReturns the current day of the month from a date - with today's date, it returns:29
HourReturns the current hour from a time - with the current time, it returns: 8
MinuteReturns the current minute from a time - with the current time, it returns: 10
SecondReturns the current second from a time - with the current time, it returns: 28
Functions for time and dates
![Page 15: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/15.jpg)
Weekday Returns the current day of the week from a date - with today's date, it returns: 3NOTE: this function has to be called with the argument "the first day of the week" (eg. Monday or Sunday) as well- like this: Weekday(Now,vbMonday)
Weekday function
![Page 16: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/16.jpg)
ASP Variables Variables are used to store information. The example demonstrates
◦ how to declare a variable, assign a value to it, and use the value in a text.
<!DOCTYPE html><html><body>
<%dim namename="Donald Duck"response.write("My name is: " & name)%>
</body></html>
![Page 17: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/17.jpg)
For Initializion To Expressions Statement Next
Loops “For loop”
![Page 18: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/18.jpg)
Loops “For loop example”For Initializion To Expressions Statement Next
![Page 19: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/19.jpg)
Do {While | Until} condition Statement Loop
OR
Do Statement Loop {While | Until} condition
Do ... LoopDo Statement Loop {While | Until} condition
![Page 20: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/20.jpg)
Do .. Loop example
![Page 21: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/21.jpg)
Output
![Page 22: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/22.jpg)
Loops within loops
![Page 23: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/23.jpg)
If condition Then statement Else statement End If
Conditions : If ..Then..Else
![Page 24: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/24.jpg)
= Equals< Less than> Greater than<= Less than or equal to> = Greater than or equal to<> Not equal toANDORNOT
Logical Operators
![Page 25: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/25.jpg)
Example “AND”
![Page 26: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/26.jpg)
If ... Then ... ElseIf ... Else
![Page 27: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/27.jpg)
Select Case Expression Case 1 statement Case 2 statement Case Else statement End Select
Select ... Case
![Page 28: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/28.jpg)
Comments
![Page 29: Web Design & Programming](https://reader031.vdocuments.us/reader031/viewer/2022020219/56815e60550346895dccda7f/html5/thumbnails/29.jpg)
http://html.net/tutorials/asp/lesson8.asp
Arrays