98-361: MTA SDF, Lesson 4

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What are the two main elements of the ASP.NET infrastructure ?

1. A set of classes and interfaces that enable communication between the Web browser and Web server. These classes are organised in the System.Web namespace. 2. A runtime process, also known as the ASP.NET worker process (aspnet_wp.exe), that handles the Web request for ASP.NET resources.

What benefits does using SOAP provide ?

1. As the Web service messages are formatted as XML, they're easier for non-compatible systems to understand. 2. Because these messages are transmitted over HTTP, they can normally reach any machine on the internet without being blocked by firewalls.

What happens behind the scenes when a Web server executes a request for an ASP.NET page ?

1. IIS receives a HTTP request, and uses the filename to determine which Internet Server Application Programming Interface (ISAPI) to run to process the request. When request is for an ASP.NET page, the request is passed to the ISAPI DLL capable of handling requests for ASP.NET pages (which is aspnet_isapi.dll). 2. The aspnet_isapi.dll passes the request to the ASP.NET worker process (aspnet_wp.exe) which fulfills the request. 3. ASP.NET worker process compiles the .aspx file into an assembly and instructs the CLR to execute the assembly. 4. When the assembly executes, it utilises the various classes in the .NET Framework library to accomplish its task and generate response messages for the requesting client. 5. ASP.NET worker process collects the responses generated by the execution of the Web page, creates a response packet, and passes it to the aspnet_isapi.dll process. 6. Aspnet_isapi.dll forwards the response packet to IIS, which passes the response back to the client requesting machine.

What are the important stages in the ASP.NET page life cycle ?

1. Page Request 2. Start (Associated Stage: Preinit) 3. Initialization (Associated Stage: Init) 4. Load (Associated Stage: Load) 5. Postback Event Handling 6. Prerendering (Associated Stage: Prerender) 7. Rendering 8. Unload (Associated Stage: Unload)

What client-side techniques exist ?

1. Query strings 2. Cookies 3. Hidden fields 4. ViewState

Name 2 key technologies that make Web services possible

1. SOAP (Simple Object Access Protocol) 2. WSDL (Web Services Description Language)

What Server-Side techniques for ASP.NET exist ?

1. Session State 2. Application State

What information does a WSDL file include ?

1. The data types it can process 2. The methods it exposes 3. The URLs through which those methods can be accessed

Give me a high level overview of how an ASP.NET application works

1. The user requests a resource from a Web server by entering a URL into a Web browser. The browser sends a HTTP request to the destination Web server. 2. The Web server analyses the HTTP request and searches for a process capable of executing the request. 3. Result of the HTTP request is returned to the client browser in the form of a HTTP response. 4. Browser reads the the HTTP response and renders it as a Web page to the user.

What is the syntax for adding a link to a HTML page ?

<a href="http://www.website.com/link.html">

What is the syntax for adding an image to a HTML page ?

<img src="image.jpg>

What is a Web site ?

A Web site is a container of applications and virtual directories. A virtual directory is an alias that maps to a physical directory on the Web server.

What's a Web farm ?

A collection of Web servers used collectively to serve a Web site. Web farms are necessary to support traffic on popular Web sites. Session state can be configured for storage on another server or an SQL server, and can be useful so a users request can be processed by one on many servers in a Web farm.

How is a Web site deployed ?

A simple web site is deployed by copying the files to the correct location, with xcopy or FTP being the two most common ways. More complex Web sites may need a Windows Installer which can perform a number of custom actions during the deployment process such as the creation of virtual directories, restarting of services, registration of components, etc.

What is a web page ?

A web page is a document that is served over the World Wide Web (WWW) and can be displayed in a web browser. Web pages are developed using HTML, and are stored on a Web server. Web browsers download the requested HTML from the Web server and render it on the users screen.

What is a Web service ?

A web service is a software component that can be accessed over a network using standard network protocols such as HTTP. Web services are described using WSDL (Web Services Description Language).

What is AJAX ?

AJAX is shorthand for 'Asynchronous Javascript and XML'. It uses Javascript extensively in order to provide responsive Web applications.

Explain Session State

ASP.NET creates a unique session for each user who sends a request to the application. Each of these sessions is identified by a unique SessionId which is sent to the requesting URL. This SessionId is transmitted as a cookie or embedded in the URL, depending on the application configuration. A common example of this is the storing of shopping cart contents for users as they browse a Web store.

What is ASP.NET ?

ASP.NET is part of the .NET Framework that enables you to develop programmable Web forms and Web Services. ASP.NET applications can be developed in any language that is compatible with the .NET common language runtime, including C# and Visual Basic.

Describe the ASP Lifecycle Stage: 3. Initilisation

All controls on the page are initialised and made available. An event handler for the Init event is the best place for code you want to be executed prior to further page processing.

Explain Application State

Application state is used to store data that is used throughout an application. It can be easily accessed through the Application property of the page class. This property provides access to the HttpApplicationState object that stores the application state as a collection of key-value pairs.

What are Cascading Style Sheets (CSS) ?

Cascading Style Sheets allow you to store a Web pages style and formatting information seperate from the HTML code. This seperation makes it easier to update the look and feel of your Web site. HTML specifies *what* will be displayed and CSS specificies *how* it will be displayed. CSS enables you to seperate the layout of a Web page from its content, making it easier to maintain and make changes to a Web site. CSS can be included in the HTML itself, or included in a seperate file and referenced by the HTML document. When done this way, the users browser will download and store the CSS files locally, enabling them to be used on multiple pages without need to download them every time, and thus reducing unnecessary data transfer.

How do client-side state management techniques work ?

Client-side state management use HTML code and the capabilities of the Web browser to store state information on the client computer.

Describe the ASP Lifecycle Stage: 2. Start

Determines whether the request is a postback or a new request. Several page properties such as Request, Response, IsPostback, and UICulture are set at this stage.

Describe the typical elements of a HTML page

Each HTML will have a pair of <html> tags at the start and end of a page. Within those <html> tags, will be a pair of <head> tags, and after those, a pair of <body> tags. Those are the essentials for every HTML page.

What is involved in deploying an ASP.NET application ?

Generally its not complicated, as ASP.NET provides xcopy deployment. In other words, all you need to do to deploy an ASP.NET Web site to a Web server is to copy the files to the right location. You can copy the files using either the Windows xcopy command or an FTP application.

What is HTML ?

HTML is the language Web servers and Web browsers use to describe a Web page. It stands for Hypertext Markup Language, and is a text based language that uses various markup tags to describe how content is displayed. It allows images, videos & other objects to be referenced in a file to create multimedia Web pages. It can also be used to embed scripts like Javascript, and can also include CSS to define the fomatting and layout of a pages content. A Web browser reads a pages HTML and renders the results on the screen.

What is HTTP ?

HTTP is the underlying communication protocol used by the World Wide Web (WWW). HTTP provides the common language the Web servers and Web browsers use to communicate.

Explain Hidden Fields

Hidden fields contain information that is not displayed on a web page, but is still part of the pages HTML code. They are created with the <input type="hidden"> HTML element, and the ASP.NET HTMLInputHidden also maps to this HTML element.

Describe the ASP Lifecycle Stage: 4. Load

If request is a postback, the Load stage is used to restore control properties with information from view state and control state. A method that handles the Load event is the best place to store initialisation code for any controls specific to this page.

Describe the ASP Lifecycle Stage: 5. Postback Event Handling

If the request is a postback, the control event handlers are called during this stage. The input values are then validated and the IsValid property for the Page class is set.

What is IIS ?

Internet Information Services. It's a Web server for hosting Web applications on the Windows operating system. An IIS server uses the concepts of sites, applications and virtual directories.

What is state management ?

It is the process of maintaining state for a Web page across round-trips. The values of the variables and controls collectively make up the state of a Web page. ASP.NET provides several techniques for preserving state information across postbacks, and can be broadly categorised as either client-side or server-side depending on where the resources are consumed.

Why is state management important ?

Its important due to the disconnected nature of HTTP, ie the client and the server are not continuously connected, they only communicate with each other when required. There are both client-side and server-side state management techniques available.

How does Javascript work ?

Javascript executes code on the clients side through their Web browser, thus enabling more responsive and interactive Web pages. By executing on the client side, it minimises server load. The runtime behaviour then depends on the client's browser that executes the Javascript, and thus for Javascript, the type of page or type of the server do not matter, only the client's browser.

What is Javascript ?

Javascript is a client-side scripting language that runs inside Web browsers to create more interactive pages than are possible with HTML alone. It is used widely and supported by virtually all Web browsers.

Do all browsers support Javascript ?

No. Most modern browsers do, but it can be turned off. A <noscript> element can be used to display a specific message to users who have opted not to use Javascript in their browser.

Describe the ASP Lifecycle Stage: 7. Rendering

Page calls the Render method for each control and populates the response that will be sent to the Web browser.

Server-Side Programming

Programs that are executed completely on a server and make use of the servers computational resources. Minimises demand on client computing resources. ASP.NET, PHP, and Ruby on Rails are examples.

Client-Side Programming

Programs that execute completely on a users local computer. Reduces load on server resources. Javascript code and Windows forms are examples.

Describe the ASP Lifecycle Stage: 1. Page Request

Request for a page is received and the page lifecycle begins. ASP.NET then decides whether the page can be readily served from the cache or whether it needs to be parsed and compiled.

Describe the ASP Lifecycle Stage: 8. Unload

Response is sent to the client and page cleanup is performed. As part of this cleanup, page properties such as Request and Response are discarded.

How do server-side state management techniques work ?

Server-side techniques use server resources to store state information. Doing so eliminates the possibility that the client-side code can be hacked or read, but by virtue of its nature increases server load and requires additional server resources to serve the Web pages.

What is SOAP ?

Simple Object Access Protocol. The protocol for exchanging structured information in a Web service communication between 2 remote computers. SOAP defines how remote computers exchange messages as part of a Web service communication. It relies on XML as its message format, and uses HTTP to transmit its messages.

Explain Query strings

State is maintained by putting the data as a set of key-value pairs in the query portion of the URL. This is the 'q=something' part of a search URL for example. Here, the 'q' is the query string key, and the 'something' is the value. To retrieve the value of the key then in an ASP.NET page, the expression Request is used. QueryString is a property of the Request object, and it gets the collection of all the query-string variables.

Describe the ASP Lifecycle Stage: 6. Prerendering

This stage signals that the page is about to render its contents. An event handler for the Prerender event is the last chance to modify the page's output before it's sent to the client.

What are the benefits of storing your Javascript in a seperate file ?

Two; improved maintainability, and improved performance. If you use the same Javascript code on each page, you can store the code on a central page rather than repeating it every time. This way you will only have to change the code in one place if you need to. Likewise, storing the Javascript code in a seperate file reduces the size of a Web page, and browsers can download and cache the external Javascript file so it isn't downloaded again unless it is modified.

Explain URL

Uniform Resource Locator. HTTP uses a URL to uniquely identify and address each resource on the Internet. Each URL starts with a protocol, then states the address of the web server, then finally the resource in question, ie http://www.damien.com/picture.jpg. HTTP is the most common protocol, but others exist, like HTTPS (secure HTTP) for example.

Explain ViewState

ViewState is the mechanism that ASP.NET uses to maintain the state of controls across page postbacks. This is facilitated by ASP.NET collecting all the values of all non-postback controls that are modified in the code, and formatting them into a single encoded string. This string is then stored in a control name _VIEWSTATE, which is enabled by default in an ASP.NET application.

What is WSDL ?

Web Services Description Language. An XML-based language for describing Web services, which provides a standard by which a Web Service can tell its client what kinds of messages it will accept and what results will be returned. A WSDL file acts as the public interface of a Web service.

What is Web hosting ?

Web hosting involves setting up a Web server with the correct code files and settings so that remote users can successfully access a Web application. ASP.NET applications must be deployed on an IIS Web server, which is an integral part of Windows Server operating systems and provides functionality for hosting Web sites.

Can a Web service exist without a WSDL file ?

Yes, but you must know the exact incoming SOAP message that the Web service expects before you can use that service.

Is there a difference between the terms 'Internet' and 'the Web' ?

Yes, the Internet is a global data communications system that provides connectivity among computers, in other words the platform. The Web in comparison is simply one of several services available on the Internet that allows users to access hyperlinked resources.


Set pelajaran terkait

"How the Mass Media Divide Us" by Diana Mutz

View Set

a&p chapter 25 quiz and homework

View Set

GMetrix Computer Fundamentals Practice Questions

View Set

Sell Products or Services Online - Google Digital Garage

View Set

alterations in respiratory function

View Set