Basic Scripting in VBScript  VBScript must enclosed by  No HTML code is allowed inside a VBScript code block  Nested scripting block is not allowed.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

PHP I.
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
The Web Warrior Guide to Web Design Technologies
Objectives Using functions to organize PHP code
1 PHP Statement Constructs Server Scripting. 5-2 Basic Statement All Statements end in a semicolon. Statements are delimited from the HTML code by enclosing.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Basics of ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Installing ASP.NET and Web Matrix Data Types Branching Structure Procedures.
1 Active Server Pages Active Server Pages (ASPs) are Web pages ASP = server-side scripts + HTML The appearance of an Active Server Page depends on who.
Introduction to Active Server Pages
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
DT228/3 Web Development Active Server Pages & IIS Web server.
Active Server Pages Points of Interest Chapters 1-4.
Lesson 16. Extensible Markup Language (XML) World Wide Web Consortium (W3C) – non-profit organizations that maintains standards for the web presented.
PHP: Introduction By Trevor Adams.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
PHP Overview CS PHP PHP = PHP: Hypertext Preprocessor Server-side scripting language that may be embedded into HTML One goal is to get PHP files.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
 2004 Tau Yenny, SI - Binus M0194 Web-based Programming Lanjut Session 1.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009.
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?
Tutorial 10 Programming with JavaScript
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
Website Development with PHP and MySQL Saving Data.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
PHP Programming with MySQL Slide 4-1 CHAPTER 4 Functions and Control Structures.
PHP PHP: Hypertext Preprocesor Personal Home Page Tools.
7 Chapter Seven Client-side Scripts. 7 Chapter Objectives Create HTML forms Learn about client-side scripting languages Create a client-side script using.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
ASP Objects Active Server Pages (cont..) 1. 2 ASP : Objects ASP provides built-in objects for performing useful tasks that simplify web development.
1 Scripting Languages VBScript - Recognized mainly by Internet Explorer only - Netscape does have a plug-in JavaScript - Recognized by Internet Explorer.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
INT213 INT213 – Managing Windows with VBScript VBScript Variables ASP State Management.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
January 27, 2001ASP Basics1 Active Server Pages (ASP) Basics The client/server model Objects Forms Active Server Pages VBScript Lab and Homework.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 3 PHP Advanced.
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,
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
By “FlyingBono” 2009_02By FlyingBono.  ASP code is embedded in HTML using tags.  A ASP scripting block always starts with.  Server scripts are executed.
INT213 – WEEK 1 ASP tags and comments Variables, Constants, and "Literals" Simple Output.
Lecture 6 Sara Almudauh ASP.NET Part 1 Development of Internet Application 1501CT - Sara Almudauh.
Tutorial 10 Programming with JavaScript
Programming the Web Using Visual Studio .NET
DBW - PHP DBW2017.
The Request & Response object
ASP.
Chapter 6 Variables What is VBScript?
PHP.
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Tutorial 10: Programming with javascript
PHP an introduction.
PHP-II.
Presentation transcript:

Basic Scripting in VBScript  VBScript must enclosed by  No HTML code is allowed inside a VBScript code block  Nested scripting block is not allowed  Spaces within a scripting block are ignored  A VBScript code can be placed in any where in an ASP  VB style comments are permitted

VBScript Variables  VBScript variables follows the same naming rules as other programming language (e.g, C++)  Begin with an alphabetic character  Case insensitive  Variables are not typed (variants)  The type of a variable depends on its value  All types are treated the same myVariable = myVariable = “Hello World” myVariable = True myVariable = False

Types Supported inVBScript  Numeric types Integer, byte, long, single, double  Strings, Date, Boolean (true or false)  TypeName() function  Returns the type name of a variant myVariable = “Hello World” IF typeName(myVariable) = “String” THEN …  Type constants  Compare the type of a variable myVariable = “Hello World” IF myVariable = VbString THEN …

Variable Scopes  Local variables  Variables declared inside a function or procedure  Global variables  Variables declared outside of functions/procedures  The scope of a global variable is within the page Dim var1, var2 var1 = 123 ‘global variable Sub myProcedure() var1 = “Hello World” ‘local variable

Arrays  Array size must been declared  Redim can be used to change array size  Array index starts from 0 Dim arrayA(29) ‘an array with 30 elements FOR i = 0 TO 29 arrayA(i) = “testing” NEXT  VBScript supports multi-dimension arrays Dim arrayB(4, 4) ‘an two dimensional array arrayB(0, 0) = “hello”

ASP Object Model  Standard objects:  Application object - application session management  Request object - retrieve client data  Response object - send output to browsers  Session object - client session management  Standard components:  Ad Rotator - automatic rotating AD’s  Page Counter component  Database access component  File access component

Request Object

QueryString Object  Retrieve data submitted through  URL parameters  Form fields submitted using the “GET” method  QueryString object usage  request.queryString(“classID”) returns “dt2663”  request.queryString returns a collection of namevalue pairs <% for each qsName in request.queryString response.write(qsName) next %>

QueryString Element Count Request.queryString(a-name).Count  Returns the number of values of a name itemNo=JK100,JK231,JK681 request.queryString(itemNo).count ---> 3  Used for multi-valued name value pairs  Multiple checkboxes  Multiple selected items in a dropdown list  Any form fields with multiple values

QueryString Example <% for each qsName in request.queryString valNum = request.queryString(qsName).count response.write(qsName & "=") if valNum = 1 then val = request.queryString(qsName) response.write(val) else for i = 1 to valNum val = request.queryString(qsName)(i) response.write(val & ",") next end if response.write(" ") next %>

Form Object  Allows to access form submission data  The methods are similar to that of queryString <% for each formField in request.form valNum = request. form(formField).count response.write(formField & "=") if valNum = 1 then val = request. form(formField) response.write(val) else for i = 1 to valNum val = request. form(formField)(i) response.write(val & ",") next end if response.write(" ") Next %>

Response Object  Generate HTML output for web browsers  Response.write() is used in a scripting block to produce output response.write(request.queryString(qsName))  is a short cut for request.write() function <% myVariable = “Hello” youVariable = “World” response.write(myVariable & “ “ & youVariable) %>

Response Object Properties/Methods  Response.buffer  Set it on (true) or off (false)  response.flush() - sends bufferred output & continue script processing  response.clear() - erase bufferred contents  response.end() - sends buffered output & stop script processing  Response.expires = minutes When cached pages should expire in web browsers  Response.expiresAbsoluate = date/time When cached pages expire in web browsers  Response.redirection = URL Branch off to the specified web page

Summary  ASP Architecture  ASP object model  Basic VBScript scripting techniques  VBScript control structures  Request object  Response object