Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Software Testing and Quality Assurance Lecture 33 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.

Similar presentations


Presentation on theme: "1 Software Testing and Quality Assurance Lecture 33 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques."— Presentation transcript:

1 1 Software Testing and Quality Assurance Lecture 33 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques

2 2 Lecture Outline Script code Submitting the Form data Introduction to Active Server Pages (ASP)

3 3 Client Side Scripting Any given.html file may contain blocks script code Processed by the requesting browsers. Reasons client side scripting is used To validate user input before posting back to the web server. To interact with Document Object Model (DOM) of the target browser.

4 4 Client Side Scripting Many scripting languages; for example VBScript and JavaScript.

5 5 Client Side Scripting - Example This is Cars web site <!- - function btnhelp_onclick() { //Help the user along. alert (“Please click Submit….”); } //--> <!-- <input id=“btnHelp” type=“button” value=“help” Name=“btnHelp” onClick=“return btnHelp_onClick()”>

6 6 Submitting the Form Data Once you have a simple HTML page Need to examine how to transmit the form data back to the Web Server for processing. While building an HTML form, We typically supply an action attribute on the opening tag To specify the recipient of the incoming form data.

7 7 Submitting the Form Data - GET Possible receivers include Mail servers, other HTML files, An Active Server Page (ASP) …… etc. For example, <form name=“MainForm” ID=“MainForm” Action=http://localhost/Cars/xxxxx.asp method = “GET”>http://localhost/Cars/xxxxx.asp …..

8 8 Submitting the Form Data - GET When the submit button for current form is clicked, the form data should be sent to the xxxx.asp file located within the Cars virtual directory.

9 9 Submitting the Form Data - GET “GET” as a mode of transimission The form data is appended to the query string as a set of name/value pairs For example, http://localhost/Cars/xxxxx.asphttp://localhost/Cars/xxxxx.asp?txtUserNa me=Ahmed&txtPassword=mypassword &btnSubmit=Submit

10 10 Submitting the Form Data - POST The other method of transmitting form data to the Web Server is To specify method = “POST” <form name=“MainForm” ID=“MainForm” Action=http://localhost/Cars/xxxxx.asp method = “POST”>http://localhost/Cars/xxxxx.asp …..

11 11 Submitting the Form Data - POST The data is not appended to the query string But instead is written to a separate line within the HTTP header. The data is directly visible to the outside word and A wee bit more secure.

12 12 A classic Active Server Page Goal of ASP is to Dynamically build HTML on the fly using server- side script logic and A small set of classic COM objects and related COM libraries. For example, A server side VBScript (or JavaScript) block that reads a table from a data source Using classic ADO and returns The rows as a generic HTML Table.

13 13 A classic Active Server Page - Example The Cars Page User Name: Password: Begins and ends with standard tags. To examine the values contained in each HTML widget submitted via method = “GET”

14 14 A classic Active Server Page - Example The Cars Page User Name: Password:  Insert the following directly into the HTTP response.

15 15 A classic Active Server Page - Example Load the default.html page and submit the data. Once script is processed on the web server, a dynamic HTML page is displayed.

16 16 Responding the POST submissions User Name: Password: Note: Request.QueryString() method is only able extract data submitted via the GET method.

17 17 Problems with Classic ASP Perhaps, the biggest downfall of classic ASP is the same point that makes it a powerful platform. Server side scripting language. Scripting languages are interpreted Thus, not robust as OO programming techniques.

18 18 Problems with Classic ASP For example, under classic ASP There were not concept of classical inheritance or classical polymorphism. It does not generate very modularized code.

19 19 Problems with Classic ASP ASP is a blind of HTML and script in a single page Most ASP web applications are a confused mix of two very different programming techniques. A web framework would allow the presentation logic (i.e. HTML tags) to Exist independently from the business logic (i.e. functional code).

20 20 Problems with Classic ASP Classic ASP demands a good deal of Redundant script code that tends to repeat between projects.

21 21 Key Points HTML files usually contain blocks of script code. ‘GET’ and ‘POST’ methods to transmit the data back to the web servers for processing. ASP aim to dynamically build HTML using script logic and small set of COM objects.


Download ppt "1 Software Testing and Quality Assurance Lecture 33 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques."

Similar presentations


Ads by Google