Adventures in VBScript - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Adventures in VBScript

Description:

Can be the website itself or a virtual directory inside the ... Any HTML code that the VB executor encounters is output directly to the resultant HTML page ... – PowerPoint PPT presentation

Number of Views:124
Avg rating:3.0/5.0
Slides: 17
Provided by: farr159
Category:

less

Transcript and Presenter's Notes

Title: Adventures in VBScript


1
Adventures in VBScript
  • Session 2

2
Windows Scripting
  • http//msdn.microsoft.com/library/default.asp?url
    /nhp/Default.asp?contentid28001169

3
JavaScript URL
  • http//wp.netscape.com/eng/mozilla/3.0/handbook/ja
    vascript/index.html

4
An IIS Application
  • Configuration is set inside IIS
  • Can be the website itself or a virtual directory
    inside the website
  • Can have a global.asa file

5
A Simple HTML Web Page (vbexample.htm)
  • lthtmlgt
  • ltheadgt
  • lt/headgt
  • ltbodygt
  • Hello there!
  • lt/bodygt
  • lt/htmlgt

6
Same Page in VBScript x 2
  • lt_at_language "VBScript"gt
  • lt
  • response.write ("lthtmlgt")
  • response.write("ltheadgtlt/headgt")
  • response.write("ltbodygt")
  • response.write("Hello there!")
  • response.write("lt/bodygtlt/htmlgt")
  • gt
  • lt_at_language "VBScript"gt
  • lthtmlgt
  • ltheadgtlt/headgt
  • ltbodygt
  • lt
  • response.write("Hello there!")
  • gt
  • lt/bodygt
  • lt/htmlgt

7
ASP Page as a Program
  • lt_at_language "VBScript"gt
  • lt
  • response.write ("lthtmlgt")
  • response.write("ltheadgtlt/headgt")
  • response.write("ltbodygt")
  • response.write("Hello there!")
  • response.write("lt/bodygtlt/htmlgt")
  • gt

8
ASP Page as HTML Page
  • lt_at_language "VBScript"gt
  • lthtmlgt
  • ltheadgtlt/headgt
  • ltbodygt
  • lt
  • response.write("Hello there!")
  • gt
  • lt/bodygt
  • lt/htmlgt

9
Why ASP?
  • The web page is dynamic!

10
A Dynamic Page
  • lt_at_LANGUAGE"VBSCRIPT" gt
  • lthtmlgt
  • ltheadgt
  • lttitlegtTime Pagelt/titlegt
  • lt/headgt
  • ltbodygt
  • The current (server) time is lttime()gt
  • lt/bodygt
  • lt/htmlgt

11
HTML in VBScript
  • Any HTML code that the VB executor encounters is
    output directly to the resultant HTML page

12
The Global.ASA File
  • A special ASP page
  • Allows for application startup and shutdown
    procedures
  • Allows for session startup and shutdown
    procedures

13
An Example Global.ASA
  • ltSCRIPT LANGUAGEVBScript RUNATServergt
  • Sub Application_OnStart
  • 'application startup code goes here
  • end sub
  • Sub Application_OnEnd
  • 'application shutdown code goes here
  • end sub
  • Sub Session_OnStart
  • 'session startup code goes here
  • End Sub
  • Sub Session_OnStart
  • 'session shutdown code goes here
  • End Sub
  • lt/SCRIPTgt

14
Two Important Objects
  • Response object
  • Request object

15
The Response Object
  • Response.write
  • Response.buffer
  • Response.redirect

16
The Request Object
  • Request.querystring
  • Request.form
Write a Comment
User Comments (0)
About PowerShow.com