TIF_Crews_Ch12

advertisement
Programming Right From the Start with Visual Basic.NET
CHAPTER 12
Web Forms and ASP.NET
True-False Questions
1.
HTML works well in Netscape Navigator but not in Internet Explorer.
Answer: False
Level: Easy
Section: 12-1
Page: 320
2.
The end tag has a slash (/) in front of the tag’s text.
Answer: True
Section: 12-1
Level: Easy
Page: 320
3.
Tags are used to instruct the browser on how to format text displayed on the screen.
Answer: True
Level: Easy
Section: 12-1
Page: 320
4.
Every start tag is paired with an end tag.
Answer: False
Section: 12-1
Level: Easy
Page: 320
Tags that will cause the text to be italic are [I] /[I].
Answer: False
Section: 12-1
Level: Easy
Page: 320
5.
6.
BL is the HTML tag that will cause a line break to appear.
Answer: False
Level: Moderate
Section: 12-1
Page: 321
7.
A text file with HTML code and the .html extension can be viewed in any browser.
Answer: True
Level: Moderate
Section: 12-1
Page: 322
8.
A jpg image can be displayed with the <img SRC> tag.
Answer: True
Level: Hard
Section: 12-1
Page: 321
9.
Putting quotations around the name of a file will guarantee that Notepad does not make .txt the
file extension.
Answer: True
Level: Moderate
Section: 12-1
Page: 321
10.
A simple HTML document is best used for displaying information only.
Answer: True
Level: Moderate
Section: 12-2
Page: 322
12 - 1
Chapter 12 – Web Forms and ASP.NET
11.
Special computers are needed for web servers that display dynamic web pages.
Answer: False
Level: Moderate
Section: 12-2
Page: 322
12.
Web applications follow the client/server model of computer system deployment.
Answer: True
Level: Moderate
Section: 12-2
Page: 322
13.
Only ASP.NET can be used to create web applications.
Answer: False
Level: Easy
Section: 12-2
Page: 323
14.
The browser component of a web application is the best place to process information.
Answer: False
Level: Easy
Section: 12-2
Page: 323
15.
Every postback results in an HTML document being sent to the client browser.
Answer: True
Level: Moderate
Section: 12-2
Page: 323
16.
A round trip occurs when a web server sends an HTML document to the browser and the user
responds to the new document.
Answer: False
Level: Moderate
Section: 12-2
Page: 323
17.
The web server is a good place to enforce the business logic on an application.
Answer: True
Level: Moderate
Section: 12-2
Page: 324
18.
To improve efficiency a client browser will typically connect directly with a database.
Answer: False
Level: Hard
Section: 12-2
Page: 324
19.
ASP.NET is used to connect a Visual Basic program to a database.
Answer: False
Level: Easy
Section: 12-3
Page: 324
20.
Visual Studio .NET is required to create ASP.NET applications.
Answer: False
Level: Easy
Section: 12-3
Page: 324
21.
The symbols <% and /%> are used to signify ASP.NET code.
Answer: False
Level: Moderate
Section: 12-3
Page: 324
22.
ASP.NET code allows VB.NET variables to be placed inside HTML code.
Answer: True
Level: Moderate
Section: 12-3
Page: 324
12 - 2
Chapter 12 – Web Forms and ASP.NET
23.
The older version of ASP and the newer version of ASP.NET cannot run at the same time
because they both use the same .asp file extension.
Answer: False
Level: Easy
Section: 12-3
Page: 325
24.
The Microsoft IIS software allows any Windows-based machine to act as a web server.
Answer: True
Level: Easy
Section: 12-3
Page: 325
25.
An HTML page can be viewed after placing it in the C:\Inetpub\wwwroot folder.
Answer: True
Level: Moderate
Section: 12-3
Page: 325
26.
ASP.NET code is not visible in the source code of an HTML page.
Answer: True
Level: Moderate
Section: 12-3
Page: 326
27.
A disadvantage of using Visual Studio for web application development is the presence of drag
and drop controls.
Answer: False
Level: Easy
Section: 12-4
Page: 326
28.
A disadvantage of using Notepad for web application development is the lack of code award
editors.
Answer: True
Level: Easy
Section: 12-4
Page: 326
29.
Every web form contains two files: one for the interface and one for the code.
Answer: True
Level: Easy
Section: 12-4
Page: 327
30.
When an HTML page is run, a web server will create an ASP.NET web form.
Answer: False
Level: Moderate
Section: 12-4
Page: 327
31.
Server-side controls have a green triangle, client side controls do not.
Answer: True
Level: Moderate
Section: 12-4
Page: 327
32.
One similarity between web and windows forms is that they are both event driven.
Answer: True
Level: Moderate
Section: 12-4
Page: 327
33.
The default location for an ASP.NET project is http://localhost.
Answer: True
Level: Hard
Section: 12-4
Page: 328
34.
Access to an IIS server is required to create an ASP.NET application.
Answer: True
Level: Moderate
12 - 3
Chapter 12 – Web Forms and ASP.NET
35.
Section: 12-4
Page: 328
Web controls are located in a menu called WebTools.
Answer: False
Section: 12-4
Level: Moderate
Page: 330
36.
The properties for a web textbox control are identical to a window textbox control.
Answer: False
Level: Hard
Section: 12-4
Page: 330
37.
The file that holds the event code for a web form must be written in Visual Basic.
Answer: False
Level: Moderate
Section: 12-4
Page: 331
38.
Web applications should be created when processing needs to be done on the local machine.
Answer: False
Level: Moderate
Section: 12-4
Page: 332
39.
A Windows application is an example of a thin front-end application.
Answer: False
Level: Moderate
Section: 12-4
Page: 332
40.
The design of a project should always precede the implementation phase.
Answer: True
Level: Moderate
Section: 12-4
Page: 334
Multiple Choice Questions
41.
HTML stands for:
a.) Huge Makeup Language.
b.) Huge Text Makeup Language.
c.) Hypertext Makeup Language.
d.) Hypertext Markup Language.
e.) None of the above.
Answer: d
Section: 12-1
42.
Level: Easy
Page: 320
Which symbol is used to enclose HTML tags?
a.) ( )
b.) < >
c.) [ ]
d.) { }
e.) None of the above.
Answer: b
Section: 12-1
Level: Easy
Page: 320
12 - 4
Chapter 12 – Web Forms and ASP.NET
43.
Which symbol identifies an HTML end tag?
a.) !
b.) |
c.) /
d.) \
e.) ?
Answer: c
Section: 12-1
44.
Level: Moderate
Page: 320
Which HTML tag does not use an end tag?
a.) B
b.) center
c.) HR
d.) I
e.) U
Answer: c
Section: 12-1
45.
Level: Moderate
Page: 321
Which statement is not true?
a.) An HTML document can be displayed in any internet browser.
b.) HTML is used to change the formatting of the displayed text.
c.) An HTML document is created with an HTML development editor.
d.) Both a and b.
e.) All of the above.
Answer: c
Section: 12-1
46.
Level: Moderate
Page: 321
Which HTML tag creates a link to another browser page?
a.) A href
b.) A ref
c.) An href
d.) An ref
e.) href
Answer: a
Section: 12-1
47.
Level: Hard
Page: 321
Which type of computer should host a web server?
a.) Apple
b.) IBM
c.) Sun
d.) UNIX
e.) Any type can host a web server.
Answer: e
Section: 12-2
Level: Easy
Page: 322
12 - 5
Chapter 12 – Web Forms and ASP.NET
48.
Where does a web application reside?
a.) Web client
b.) Web server
c.) Visual Studio .NET
d.) Both a and b.
e.) All of the above.
Answer: b
Section: 12-2
49.
Level: Moderate
Page: 322
Which is an example of a web document?
a.) Server script
b.) Web page
c.) Client browser
d.) Both a and b.
e.) All of the above.
Answer: d
Section: 12-2
50.
Level: Hard
Page: 322
Which is an advantage of using a Web application to deliver an Information System solution?
a.) Most end users are familiar with using an internet browser.
b.) Web applications are platform independent.
c.) Upgrading the application is not very costly.
d.) Both a and b.
e.) All of the above.
Answer: e
Section: 12-2
51.
Level: Easy
Page: 323
A postback occurs when:
a.) a browser posts a form to the server.
b.) a user’s action activates the handing of a server event.
c.) a server posts a form to the client.
d.) Both a and b.
e.) All of the above.
Answer: d
Section: 12-2
52.
Level: Moderate
Page: 323
When does a “round trip” start in a web application?
a.) The server requests an action from the user.
b.) The user activates a server control event.
c.) The browser posts a form to the server.
d.) The server processes a control event.
e.) The server posts a new HTML page.
Answer: b
Section: 12-2
Level: Hard
Page: 323
12 - 6
Chapter 12 – Web Forms and ASP.NET
53.
Which software can be used to create an HTML page?
a.) Notepad
b.) Word
c.) Visual Studio .NET
d.) Both a and b.
e.) All of the above.
Answer: e
Section: 12-3
54.
Level: Moderate
Page: 324
Which set of symbols are used to signify the presence of ASP.NET code?
a.) <@
b.) <#
c.) <$
d.) <%
e.) <&
Answer: d
Section: 12-3
55.
Level: Moderate
Page: 324
Which is the file extension used for an ASP.NET file?
a.) asn
b.) asp
c.) aspn
d.) aspx
e.) asx
Answer: d
Section: 12-3
56.
Level: Easy
Page: 325
When an ASP.NET file is placed on an IIS server and viewed through a browser, the resulting
HTML page contains:
a.) all ASP.NET code.
b.) as much ASP.NET code as is in the ASP.NET file.
c.) a mix of ASP.NET and HTML code.
d.) all HTML code.
e.) None of the above.
Answer: d
Section: 12-3
57.
Level: Moderate
Page: 326
What is the extension for a Visual Basic web form interface file?
a.) .asp
b.) .aspx
c.) .asp.vb
d.) .aspx.vb
e.) .asp.vb.net
Answer: b
Section: 12-4
Level: Easy
Page: 327
12 - 7
Chapter 12 – Web Forms and ASP.NET
58.
What is the extension for a Visual Basic web form code file?
a.) .asp
b.) .aspx
c.) .asp.vb
d.) .aspx.vb
e.) .asp.vb.net
Answer: d
Section: 12-4
59.
Level: Easy
Page: 327
Which user action will not generate a server-side event?
a.) Mouse Move
b.) Text Change
c.) Button Click
d.) Both a and b.
e.) All of the above.
Answer: a
Section: 12-4
Level: Moderate
Page: 327
60.
Because of the latency of a round-trip on the internet:
a.) the interface and code of a web form are stored in separate files.
b.) only some user actions, such as button clicks, will generate events.
c.) it is best to use server-side control.
d.) web applications should be coded in Visual Basic.
e.) None of the above.
Answer: b
Level: Hard
Section: 12-4
Page: 327
61.
Which property is used to name a web control?
a.) ControlName
b.) Designation
c.) ID
d.) Name
e.) Title
Answer: c
Section: 12-4
62.
Level: Moderate
Page: 330
Which language is used to create an ASP.NET code file?
a.) Visual Basic
b.) C#
c.) C++
d.) Both a and b.
e.) All of the above.
Answer: e
Section: 12-4
Level: Moderate
Page: 331
12 - 8
Chapter 12 – Web Forms and ASP.NET
63.
It is best to use a web instead of a windows application when the application:
a.) has a thin front end (client).
b.) needs to be available to the public.
c.) must be platform-independent.
d.) Both a and b.
e.) All of the above.
Answer: e
Section: 12-4
Level: Moderate
Page: 332
Fill in the Blank Questions
64.
HTML stands for ___Hypertext Markup Language___.
Level: Easy
Section: 12-1
Page: 320
65.
Every tag is surrounded by ___angle brackets < >___.
Level: Easy
Section: 12-1
Page: 320
66.
The tags in an HTML document ___will not___ be visible in the web browser.
Level: Moderate
Section: 12-1
Page: 320
67.
The tags in an HTML document are used to change the ___formatting___ of text.
Level: Moderate
Section: 12-1
Page: 320
68.
The ___html___ tag is required in an HTML document.
Level: Moderate
Section: 12-1
Page: 321
69.
The ___P___ tag creates a paragraph break.
Level: Moderate
Section: 12-1
Page: 321
70.
A text file with the ___.html___ extension can be displayed in a web browser.
Level: Easy
Section: 12-1
Page: 321
71.
Web applications are an example of the ___client/server___ model of Information systems.
Level: Moderate
Section: 12-2
Page: 322
72.
Web documents are stored on a(n) ___web server___.
Level: Easy
Section: 12-2
12 - 9
Page: 322
Chapter 12 – Web Forms and ASP.NET
73.
The ___server script___ is used to process a client request.
Level: Moderate
Section: 12-2
Page: 322
74.
The deployment cost for a(n) ___web application___ is less than a windows application.
Level: Moderate
Section: 12-2
Page: 323
75.
The interface function of a web application resides in the ___browser/client___.
Level: Moderate
Section: 12-2
Page: 323
76.
The processing function of a web application resides in the ___server___.
Level: Moderate
Section: 12-2
Page: 323
77.
A server must wait for a ___postback___ before it can complete a round trip.
Level: Moderate
Section: 12-2
Page: 323
78.
In a web application the ___server___ will process events generated by the action of an end user.
Level: Moderate
Section: 12-2
Page: 323
79.
The ___<%=___ symbols are used to indicate that a Visual Basic variable should be inserted into
an HTML document.
Level: Moderate
Section: 12-3
Page: 324
80.
ASP.NET code will ___never___ appear in the source code of an HTML page.
Level: Moderate
Section: 12-3
Page: 325
81.
The abbreviation IIS stands for ___Internet Information Services___.
Level: Moderate
Section: 12-3
Page: 325
82.
The file extension for an ASP.NET file is ___aspx___.
Level: Moderate
Section: 12-3
Page: 325
83.
To view a file on a local IIS server, point a web browser to the address ___http://localhost/___.
Level: Hard
Section: 12-3
Page: 325
84.
ASP.NET files are located on the ___C:\Inetpub\wwwroot___ folder of an IIS machine.
Level: Moderate
Section: 12-3
Page: 325
12 - 10
Chapter 12 – Web Forms and ASP.NET
85.
RAD stands for ___Rapid Application Development___.
Level: Moderate
Section: 12-4
Page: 327
86.
A web server is needed to generate an HTML page from a(n) ___ASP.NET web form___.
Level: Moderate
Section: 12-4
Page: 327
87.
The ___Web Form___ contains a user interface form and code file.
Level: Moderate
Section: 12-4
Page: 327
88.
An event generated by a(n) __server control___ requires a round trip to complete the processing.
Level: Moderate
Section: 12-4
Page: 327
89.
The internet address for a local web server used to develop an ASP.NET application is
___http://localhost___.
Level: Moderate
Section: 12-4
Page: 328
90.
Any Visual Studio programming language can be used to create a(n) ___ASP.NET___ web
application.
Level: Moderate
Section: 12-4
Page: 331
91.
A(n) ___Web Forms___ application is useful for providing platform independent solutions.
Level: Moderate
Section: 12-4
Page: 332
Essay Questions
92.
What are the advantages of using web applications vs. window applications?
One set of advantages revolves around the centralized nature of the server side of a client/server
architecture. Code that is written for each unique application resides on a web server, not on the
thousands of end-user’s machines.
When the software is developed or changed the code is installed on the centralized server, thus
saving the expense of installing the new or updated on thousands of machines. It is also easier to
deploy any supporting documentation through this central location of a web server.
The other advantages stem from the universal nature of Internet access and web browsers.
Virtually every operating system supports the use of a web browser to access the Internet, which
makes developing web applications platform independent. Web browsers are easy to use and
available on virtually every computer.
12 - 11
Chapter 12 – Web Forms and ASP.NET
93.
Your ASP.NET web form, named MyWebProject, is located on a web server. (a) Describe the
two main files of the web form. (b) A user requests to see your web page. What does the web
server do to create your page? (c) The user pressed a button to request that two numbers are
added together. Describe the sequence of events that leads to the user seeing the new web page
with the correct answer.
(a) The first part is the graphical user interface (GUI) form which holds the controls the user
sees and interacts with. The file is called MyWebProject.aspx. The second part is the code
behind the interface, which responds to the events generated by the controls. This file is called
MyWebProject.aspx.vb.
(b) When a page is requested the web server creates a new class based on these two files. This
class contains a static HTML page, the server side (ASP.NET) controls, and the VB code. This
class will then generate the HTML page and send it to the user’s browser.
(c) When the user clicks on a button control, an event is generated and the browser sends a
postback request to the server. The web form on the server uses the code in the
MyWebProject.aspx file to process the request. A new web page is generated and sent back to the
browser.
12 - 12
Download