Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

Essentials for Design JavaScript Level One Michael Brooks
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to JavaScript
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
The Web Warrior Guide to Web Design Technologies
Chapter 31 Basic Form-Processing Techniques JavaServer Pages By Xue Bai.
Languages for Dynamic Web Documents
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Server-Side vs. Client-Side Scripting Languages
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
HTML Recall that HTML is static in that it describes how a page is to be displayed, but it doesn’t provide for interaction or animation. A page created.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
DT228/3 Web Development JSP: Directives and Scripting elements.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Introduction to scripting
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
PHP: Hypertext Processor Fred Durao
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
EIW - ASP Introduction1 Active Server Pages VBScript.
JavaScript Syntax, how to use it in a HTML document
Introduction to JavaScript CS101 Introduction to Computing.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Lecture Note 8: ASP Including Files and The Global.asa file.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part One.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
ASP Syntax Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
ASP Mr. Baha & Dr.Husam Osta  What is ASP?  Internet Information Services  How Does ASP Differ from HTML?  What can ASP do for you?  ASP Basic.
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
Introduction to.
Tonga Institute of Higher Education IT 141: Information Systems
Chapter 6 JavaScript: Introduction to Scripting
WWW and HTTP King Fahd University of Petroleum & Minerals
Active Server Pages Computer Science 40S.
Introduction to ASP By “FlyingBono” 2009_01 By FlyingBono 2009_01
Section 17.1 Section 17.2 Add an audio file using HTML
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Intro to PHP & Variables
JavaScript Introduction
Tonga Institute of Higher Education IT 141: Information Systems
JavaScript.
Tonga Institute of Higher Education IT 141: Information Systems
Tutorial 10: Programming with javascript
An Introduction to JavaScript
JavaScript: Introduction to Scripting
Presentation transcript:

Lecture Note 3: ASP Syntax

 ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source" in a browser, you will only see the output from the ASP file, which is plain HTML. This is because the scripts are executed on the server before the result is sent back to the browser.  The Basic Syntax Rule  The Basic Syntax Rule An ASP file normally contains HTML tags, just like an HTML file. However, an ASP file can also contain server scripts, surrounded by the delimiters. Server scripts are executed on the server, and can contain any expressions, statements, procedures, or operators valid for the scripting language you prefer to use.

Step 1: Step 1: –This tells the script interpreter that this script is written using JavaScript. The default for ASP is VBScript. The are script delimiters - they tell the interpreter that the code within them needs to be interpreted. Usually the code outside of the delimiters will be HTML or client side JavaScript.

Step 2: <% Option Explicit dim Qty, Price, Total Step 2: <% Option Explicit dim Qty, Price, Total –Option Explicit means that we have to dimension all of our variables before we can use them. This is a good idea because if we accidentally mis-spell something the interpreter will notice and give us a helpful error message - bugs like this are often the hardest to find, so it's good to try and avoid them if we can. Then we dimension our variables using dim - this allocates some memory for the computer to store values while our script is running. Qty = Request("Qty") Price = Request("Price") Qty = Request("Qty") Price = Request("Price") The values we entered in our form can be accessed using Request("FormVariableName"). In these two lines, we store these values in two ASP variables so that we can use them later.

Total = Qty * Price %> This is where we do the calculation.. We also close the script off by using %>, telling the interpreter that the next lines are HTML.

Step 3: Step 3: Simple calculator Simple calculator You entered. You entered. The Total amount is. The Total amount is. This is just straight HTML, but if you look carefully you'll find 2 bits of embedded ASP: and. This is telling the interpreter to substitute the value of those variables in at those points. (The = is important here - if you leave it out, you won't get anything substituted.) And there you have it, your first ASP script. This is just straight HTML, but if you look carefully you'll find 2 bits of embedded ASP: and. This is telling the interpreter to substitute the value of those variables in at those points. (The = is important here - if you leave it out, you won't get anything substituted.) And there you have it, your first ASP script.

The Response Object The Write method of the ASP Response Object is used to send content to the browser. For example, the following statement sends the text "Hello World" to the browser: The Response Object The Write method of the ASP Response Object is used to send content to the browser. For example, the following statement sends the text "Hello World" to the browser:

 VBScript  VBScript You may use different scripting languages in ASP files. However, the default scripting language is VBScript: The example above writes "Hello World!" into the body of the document.

 JavaScript  JavaScript To set JavaScript as the default scripting language for a particular page you must insert a language specification at the top of the page: Note: Unlike VBScript - JavaScript is case sensitive. You will have to write your ASP code with uppercase letters and lowercase letters when the language requires it. Note: Unlike VBScript - JavaScript is case sensitive. You will have to write your ASP code with uppercase letters and lowercase letters when the language requires it.

Examples How to write some text with ASP Examples How to write some text with ASP

 Other Scripting Languages  Other Scripting Languages ASP is shipped with VBScript and JScript (Microsoft's implementation of JavaScript). If you want to script in another language, like PERL, REXX, or Python, you will have to install script engines for them.