1 / 29

Web Design & Programming

Web Design & Programming. ASP Mr. Baha & Dr.Husam Osta 2014. Outlines. What is ASP? Internet Information Services How Does ASP Differ from HTML? What can ASP do for you? ASP Basic Syntax Rules ……. What is ASP?. ASP stands for  Active Server  Pages , or classical ASP

yoland
Télécharger la présentation

Web Design & Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Design & Programming ASP Mr. Baha & Dr.HusamOsta 2014

  2. Outlines • What is ASP? • Internet Information Services • How Does ASP Differ from HTML? • What can ASP do for you? • ASP Basic Syntax Rules • ……..

  3. 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”

  4. 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.

  5. How Does ASP Differ from HTML? • When a browser requests an HTMLfile • the server returns the file

  6. How Does ASP Differ from HTML? • When a browser requests an ASPfile • 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

  7. What can ASP do for you? • Dynamically edit, change, or add any content of a Web page • Respond to user queries or data submitted from HTML forms • Access any data or databases and return the results to a browser • Customize a Web page to make it more useful for individual users

  8. Advantages of ASP … • The advantages over other technologies, are • Simplicity • speed • Provide security since the code cannot be viewed from the browser • Clever ASP programming can minimize the network traffic

  9. 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

  10. 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>

  11. Your first ASP page HLTML ASP

  12. Working with time and dates

  13. Formatting time and dates • FormatDateTime(Date[, NamedFormat]) • The NamedFormat argument may take the following values: • vbLongDate • vbShortDate • vbLongTime • vbShortTime

  14. Functions for time and dates • YearReturns the current year from a date - with today's date, it returns: 2014 • MonthReturnsthe current month from a date - with today's date, it returns: 1 • DayReturnsthe current day of the month from a date - with today's date, it returns:29 • HourReturnsthe current hour from a time - with the current time, it returns: 8 • MinuteReturnsthe current minute from a time - with the current time, it returns: 10 • SecondReturnsthe current second from a time - with the current time, it returns: 28

  15. Weekday function • 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)

  16. 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 name name="Donald Duck"response.write("My name is: " & name) %></body></html>

  17. Loops “For loop” For Initializion To Expressions Statement Next

  18. For Initializion To Expressions Statement Next Loops “For loop example”

  19. Do Statement Loop {While | Until} condition Do ... Loop • Do {While | Until} condition Statement Loop OR Do Statement Loop {While | Until} condition

  20. Do .. Loop example

  21. Output

  22. Loops within loops

  23. Conditions : If ..Then..Else If conditionThen statement Else statement End If

  24. Logical Operators = Equals< Less than> Greater than<= Less than or equal to> = Greater than or equal to<> Not equal to AND OR NOT

  25. Example “AND”

  26. If ... Then ... ElseIf... Else

  27. Select ... Case Select Case Expression Case 1 statement Case 2 statement Case Else statement End Select

  28. Comments

  29. Arrays • http://html.net/tutorials/asp/lesson8.asp

More Related