Chapter 4 Flashcards

1
Q

What is a web page?

A

document served over world wide web and displayed in web browser. Developed using HTML (Hypertext Markup Language).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the World Wide Web?

A

interconnected hypertext documents and other resources.

Need to distinguish between web and internet. Internet is communication system that provides connectivity among computers. Web is a service available on the internet that allows access to hyperlinked resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Hypertext Transfer Protocol (HTTP)?

A

HTTP is the underlying protocol used by WWW, provides common language that web servers and browsers use to communicate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is HTTPS?

A

HTTPS - protocol for secure applications that use encryption before it is transmitted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Uniform Resource Locator (URL)?

A

A URL uniquely identifies each resource on the internet.

All documents, images, videos and resources are identified by a URL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Hypertext Markup Langugag (HTML)?

A

HTML is a language used by web server and browser to describe a web page. Uses markup tags to describe how content is displayed.

Can also embed scripts such as JavaScript to change behaviour and can include Cascading Style Sheets (CSS) to describe formatting of page. Browser reads HTML code and renders it on the screen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 2 main parts to a HTML document?

A

Head and body.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the function of the header section of a HTML document?

A

Header - used to provide document title and links to external item such as JavaScript and CSS files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the function of the body section of a HTML document?

A

Body - provides the complete structure and content of the page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of a HTML document?

A

Purpose to provide a standard language for describing Web pages so that different web browsers can understand and display page. Can be edited using any text editor.
Uses tags always inside angle brackets and in pairs -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Cascading Style Sheets (CSS)?

A

CSS - allows you to store web pages style and format separate from HTML code.Visual studio has tool to build and preview style sheets.

CSS becomes useful when trying to making site wide changes. Means can make 1 change and update multiple files across a site rather than changing each individual page.

CSS must always be inside tags in the element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is JavaScript?

A

JavaScript - client side language that runs inside browsers to create more interactive pages than possible with HTML, supported in all modern browsers. Makes websites more responsive and interactive by executing the code in client side (web browser) and minimizes unnecessary round-trips to and from web server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Where do you place JavaScript?

A

All JavaScript must be placed in script tags in head element.

Can also place JavaScript in separate file as shown below:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the benefits to placing JavaScript in a separate file?

A
  1. Improved maintainability - only need to modify code in one area rather than each page.
  2. Improved performance - reduces size of web page and also allows cached version to be held on client side, does not need to be downloaded every time unless changed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Asynchronous JavaScript and XML (Ajax)?

A

Asynchronous JavaScript and XML (Ajax) - Ajax uses JavaScript in order to provide responsive web applications, the ASP.NET AJAX framework lets you implement Ajax on ASP.NET web pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a client side program?

A

Client-side program - executes on users local computer e.g. javascript, windows forms and do not consume server resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a server side program?

A

Server-side programs - execute completely on the server and use computational resources of servers. Only local resources used are those retrieving processing results from server. Usually web applications using technology such as ASP.NET, PHP or Ruby on Rails.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a hybrid program?

A

Hybrid - recent applications make use of both server side and client side. Smart-client applications run locally on client computer and use web services to accomplish certain tasks e.g Ajax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is ASP.NET?

A

ASP.NET - part of the .NET framework that enables to develop web forms and services. Can develop in any .NET language e.g C#, Visual Basic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are the 2 main parts to ASP.NET?

A
  1. Classes and interfaces that enable communication between browser and server in System.Web namespace.
  2. Runtime process - ASP.NET worker process (aspnet_wp.exe) that handles web requests for ASP.NET resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How is a higher level web application executed?

A

Higher level web application is executed through HTTP requests and responses between browser and server.

  1. User requests resource by typing URL in browsers, sent to server.
  2. Server analyzes HTTP request and finds resource capable of executing request.
  3. Result of request is sent back to browser (HTTP response)
  4. Browser reads HTTP response and renders it as web page.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What happens when a web server executes a request for an ASP.NET page?

A
  1. Internet Information Service (IIS) receives an HTTP request, it uses file name extension to determine which Internet Server Application Programming Interface (ISAPI) program to run. When an ASP.NET request is received the aspnet_isapi.dll is run.
  2. The aspnet_isapi.dll passes the request to the ASP.NET worker process (aspnet_wp.exe)
  3. The ASP.NET worker process compiles an .aspx file into an assembly and instructs Common Language Runtime (CLR) to execute the assembly.
  4. When assembly executes it takes various .NET classes needed to carry out its work and generate response message to requesting client.
  5. The ASP.NET worker process collects responses and creates a response packet and passes it to aspnet_isapi.dll process.
  6. aspnet_isap.dll forwards the response packet to IIS, which passes to requesting client.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the stages of the page lifecycle?

A
  1. Page request
  2. Start
  3. Initialization
  4. Load
  5. Postback event handling
  6. Prerendering
  7. Rendering
  8. Unload
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What events are associated with various stages of a page lifecycle?

A
  1. Start - PreInit
  2. Initialization - Init
  3. Load - Load
  4. Prerendering - PreRender
  5. Unload - Unload
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

How do you register a method to handle an event?

A

To register a method to handle the event, do so using the common event registration pattern used in the .NET framework:

object.event += new EventHandler(eventhandler);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What are the

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is state management?

A

State management - the process of maintaining state for a page across round trips. Important issue for web applications, there are both client-side and server-side techniques available for preserving state information across page postbacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is client side state management?

A

Client-side state management uses HTML code and web browser to store state information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What are the main ways that client side state management is maintained?

A
  1. Query strings
  2. Cookies
  3. Hidden fields
  4. ViewState
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are query strings?

A

Query strings - state is maintained using set of key-value pairs in query string in URL e.g. http://www.google.com/search?q=television.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What are cookies?

A

Cookies - small packets of information held locally on a user’s computer by the web browser, usually store user preferences or shopping cart contents.

32
Q

What are hidden fields?

A

Hidden fields - contain information that is not displayed to user. Use HTML element.

33
Q

What is viewstate?

A

ViewState - used by ASP.NET by default to maintain state of controls across page postbacks. Done by collecting values of all non-postback controls and formats them into a single string in a hidden field called _VIEWSTATE. Can disable viewstate for control, also at page level and application level.

34
Q

What is server side state management?

A

Server-side management - uses server resources to store state information. Eliminates the possibility of a user hacking client side code or reading session data, but will increase the server load and additional resources to maintain a web page.

35
Q

What are the 2 ways that ASP.NET maintains server-side state management?

A
  1. Session state

2. Application state

36
Q

What is session state?

A
  1. Session state - ASP.NET creates unique session for each user who sends request and is identified by sending a unique SessionId to requesting URL. This is either stored in a cookie or embedded in URL. Common use is to maintain shopping cart contents.
37
Q

What is application state?

A

Application state - used to store data that is used throughout an application. Accessed through the Application property of the Page class. Provides access to the HttpApplicationState object that stores application state as collection of key-value pairs. Example username and password.

38
Q

What is web hosting?

A

Web hosting - setting up web server with correct code files and settings users can successfully access a web application.

39
Q

Where must ASP.NET applications be deployed?

A

ASP.NET applications must be deployed on an Internet Information Services (IIS) web server. IIS is part of Windows Server OS.

40
Q

How do you deploy an ASP.NET application?

A

Deploy ASP.NET application using either xcopy of FTP. Which means all have to do to deploy is copy correct files to correct location on server. Some complex application may require DLL files to be deployed to the Global Assembly Cache (GAC), which will require a Windows Installer package to deploy rather that xcopy.

41
Q

What are Internet Information Services (IIS)?

A

Internet Information Services (IIS) - web server for hosting Web applications on Windows services. Uses sites, applications and virtual directories.

IIS can host multiple web sites. Uses hierarchical relationship among sites, applications and virtual directories.

IIS administered using the IIS Manager tool.

42
Q

What is a web site?

A

Web site - container of applications and virtual directories accessed in combination with website address eg www.website.co.uk/account

43
Q

What is a virtual directory?

A

Virtual Directory - alias that maps to physical directory on web server.

Web server never exposes physical address and location of files, uses aliases that map to the physical directories also called virtual directories.

44
Q

What are the 2 primary ways of deploying a web application?

A
  1. xcopy / FTP - files are copied to Web server, dont require any further action such as restarting the IIS.
  2. Windows Installer - used for complex web sites, that require creating virtual directories, restarting services, registering components etc.
45
Q

What is a web service?

A

Web Service - component that can be accessed over a network using standard protocols eg HTTP. Described using the Web services description service (WSDL).

46
Q

How do web services communicate between servers and client?

A

Web services all communication between servers and client via Extensible Markup Language (XML) over HTTP.

47
Q

What 2 services make web services possible?

A
  1. Simple Object Access Protocol (SOAP)

2. Web Services Description Language (WSDL)

48
Q

What is SOAP?

A

SOAP - protocol for exchanging structured information in web service between 2 remote computers.

SOAP relies on XML as message format and HTTP for message transmission.

49
Q

What are the benefits of SOAP?

A
  1. XML means easier for non-compatible systems to understand.
  2. HTTP means they can reach nearly any machine on the Internet.
50
Q

What are the elements of SOAP?

A

Elements of SOAP - packet consists of an envelope that contains a body. Name of the method to be invoked. Example below has method named ToLower and takes single parameter by name of inputString.

SAMPLE STRING

51
Q

What is WSDL?

A

WSDL - XML based language for describing Web services. WSDL file acts as the public interface of web services include:

  1. Data types it can process
  2. Methods it exposes
  3. URLs through which methods can be accessed
52
Q

Which attribute is needed for classes exposed as XML web service?

A

Each class exposed as XML web service needs to have WebService attribute.

53
Q

Which attribute is needed for method exposed from web service?

A

Each method is exposed from web service needs WebMethod attribute.

54
Q

What attribute must be used to make a web service accessible across the web?

A

Must have a webMethod attribute to make it accessible across the web.

55
Q

What are synchronous or asynchronous methods?

A

When invoke web service method, have the choice to use a synchronous or asynchronous method. Asynchronous will increase the responsiveness of the client application.

56
Q

How do web services communicate between servers and client?

A

Web services all communication between servers and client via Extensible Markup Language (XML) over HTTP.

57
Q

What happens when you add a web reference to visual studio?

A

When add a web reference visual studio creates local proxy that represents remote service, means working with remote object similar to working with local objects. When create web reference visual studio reads WSDL file to determine which classes and methods are available to remote server. When call method on remote object, .NET framework translates it to SOAP messages and transmits them.

58
Q

You are developing a mapping Web site that allows users to interactively explore maps using actions such as panning and zooming. You want the Web site to be responsive and accessible in most modern Web browsers. However, you do not want users to have to install additional plug-ins in order to use your Web site. Which of the following technologies should you use to display maps?

a. HTML
b. Server-side programming technology such as ASP.NET
c. Adobe Flash
d. JavaScript

A

d. JavaScript

59
Q

Your ASP.NET page contains a page-level variable of Customer type. You want to preserve the value of this variable across page postbacks, but you do not need this variable in any other page in the application. Which of the following state-management techniques is the best way to achieve this?

a. Query strings
b. Cookies
c. ViewState
d. Session

A

c. ViewState

60
Q

You are developing a Web application for an online bank. Your application enables users to access their account information and transactions from within a Web browser. When a user logs onto the Web application, you want to show the username and account balance on all pages of the application until the user logs off. You also want this application to be safe from malicious users. Which of the following state-management techniques should you use?

a. Cookies
b. ViewState
c. ViewState with encryption
d. Session

A

d. Session

61
Q

You are developing a Web form to display weather information. When a user requests the Web form, the form needs to perform some initialization to change its appearance and assign values to some controls. Where should you put the code?

a. In the PreInit event handler of the Page class
b. In the Init event handler of the Page class
c. In the Load event handler of the Page class
d. In the PreRender event handler of the Page class

A

c. In the Load event handler of the Page class

62
Q

You want to display values of C# expressions in an ASP.NET page. Which of the following types of code blocks should you use to enclose the expression?

a.
b.
c.
d. …

A
63
Q

You have developed a timesheet application that will be used by all employees in your company. You used ASP.NET to develop this application and have deployed it on the company’s Web server. What must all employees of the company install on their computers before they can access the timesheet application?

a. .NET Framework Redistributable
b. .NET Framework Software Development Kit
c. Visual Studio
d. A Web browser

A

d. A Web browser

64
Q

Your client application calls a Web service that performs complex, time-consuming calculations. A user complains that while results are being returned, the user interface freezes momentarily. Which approach should you take to solve this issue?

a. You should install a better processor on the Web server.
b. You should install a better processor on the client computer.
c. You should upgrade to a faster Internet connection.
d. You should use asynchronous calls to invoke the Web service.

A

d. You should use asynchronous calls to invoke the Web service.

65
Q

You are working on two Visual Studio projects. The first project is a Web service that returns a DataSet object belonging to the System.Data namespace. The second project accesses the Web service created by the first project. Which project in this scenario requires a reference to the System.Data namespace?

a. The Web service project.
b. The client project that accesses the Web service.
c. Both the client project and the Web service project.
d. Neither the client project nor the Web service project.

A

c. Both the client project and the Web service project.

66
Q

In the HTML anchor tag (<a>), the _______ attribute specifies the target URL.</a>

A

href

67
Q

You can put CSS code in a separate file and link it to a Web page through use of the HTML ________ element.

A

script

68
Q

The JavaScript code on a Web page is executed on the _______.

A

client-side

69
Q

You can use a(n) _______ element to display a specific message to users when their browser is not running JavaScript.

A

noscript

70
Q

You can disable ViewState at the page level by setting the _______ attribute of the Page directive to false in the ASP.NET page.

A

EnableViewState

71
Q

The ______ state is used to store data that is used globally throughout an application, as opposed to the _______ state, which stores data for a user session.

A

Application, Session

72
Q

A Web application is accessed using a(n) _________ name instead of a physical folder name.

A

virtual directory

73
Q

You must mark classes with the ________ attribute to expose them as a Web service.

A

WebService

74
Q

Of all the methods in a Web service class, only those marked with _________ attributes are exposed as Web service methods.

A

WebMethod

75
Q

SOAP relies on ________ as its message format and uses ________ for message transmission.

A

XML, HTTP