Chapter 12 – Web Forms and ASP.NET
chapter 12
Web Forms and ASP.NET
True-False Questions
1.HTML works well in Netscape Navigator but not in Internet Explorer.
Answer: FalseLevel: Easy
Section: 12-1Page: 320
2.The end tag has a slash (/) in front of the tag’s text.
Answer: TrueLevel: Easy
Section: 12-1Page: 320
3.Tags are used to instruct the browser on how to format text displayed on the screen.
Answer: TrueLevel: Easy
Section: 12-1Page: 320
4.Every start tag is paired with an end tag.
Answer: FalseLevel: Easy
Section: 12-1Page: 320
5.Tags that will cause the text to be italic are [I] /[I].
Answer: FalseLevel: Easy
Section: 12-1Page: 320
6.BL is the HTML tag that will cause a line break to appear.
Answer: FalseLevel: Moderate
Section: 12-1Page: 321
7.A text file with HTML code and the .html extension can be viewed in any browser.
Answer: TrueLevel: Moderate
Section: 12-1Page: 322
8.A jpg image can be displayed with the <img SRC> tag.
Answer: TrueLevel: Hard
Section: 12-1Page: 321
9.Putting quotations around the name of a file will guarantee that Notepad does not make .txt the file extension.
Answer: TrueLevel: Moderate
Section: 12-1Page: 321
10.A simple HTML document is best used for displaying information only.
Answer: TrueLevel: Moderate
Section: 12-2Page: 322
11.Special computers are needed for web servers that display dynamic web pages.
Answer: FalseLevel: Moderate
Section: 12-2Page: 322
12.Web applications follow the client/server model of computer system deployment.
Answer: TrueLevel: Moderate
Section: 12-2Page: 322
13.Only ASP.NET can be used to create web applications.
Answer: FalseLevel: Easy
Section: 12-2Page: 323
14.The browser component of a web application is the best place to process information.
Answer: FalseLevel: Easy
Section: 12-2Page: 323
15.Every postback results in an HTML document being sent to the client browser.
Answer: TrueLevel: Moderate
Section: 12-2Page: 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: FalseLevel: Moderate
Section: 12-2Page: 323
17.The web server is a good place to enforce the business logic on an application.
Answer: TrueLevel: Moderate
Section: 12-2Page: 324
18.To improve efficiency a client browser will typically connect directly with a database.
Answer: FalseLevel: Hard
Section: 12-2Page: 324
19.ASP.NET is used to connect a Visual Basic program to a database.
Answer: FalseLevel: Easy
Section: 12-3Page: 324
20.Visual Studio .NET is required to create ASP.NET applications.
Answer: FalseLevel: Easy
Section: 12-3Page: 324
21.The symbols <% and /%> are used to signify ASP.NET code.
Answer: FalseLevel: Moderate
Section: 12-3Page: 324
22.ASP.NET code allows VB.NET variables to be placed inside HTML code.
Answer: TrueLevel: Moderate
Section: 12-3Page: 324
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: FalseLevel: Easy
Section: 12-3Page: 325
24.The Microsoft IIS software allows any Windows-based machine to act as a web server.
Answer: TrueLevel: Easy
Section: 12-3Page: 325
25.An HTML page can be viewed after placing it in the C:\Inetpub\wwwroot folder.
Answer: TrueLevel: Moderate
Section: 12-3Page: 325
26.ASP.NET code is not visible in the source code of an HTML page.
Answer: TrueLevel: Moderate
Section: 12-3Page: 326
27.A disadvantage of using Visual Studio for web application development is the presence of drag and drop controls.
Answer: FalseLevel: Easy
Section: 12-4Page: 326
28.A disadvantage of using Notepad for web application development is the lack of code award editors.
Answer: TrueLevel: Easy
Section: 12-4Page: 326
29.Every web form contains two files: one for the interface and one for the code.
Answer: TrueLevel: Easy
Section: 12-4Page: 327
30.When an HTML page is run, a web server will create an ASP.NET web form.
Answer: FalseLevel: Moderate
Section: 12-4Page: 327
31.Server-side controls have a green triangle, client side controls do not.
Answer: TrueLevel: Moderate
Section: 12-4Page: 327
32.One similarity between web and windows forms is that they are both event driven.
Answer: TrueLevel: Moderate
Section: 12-4Page: 327
33.The default location for an ASP.NET project is
Answer: TrueLevel: Hard
Section: 12-4Page: 328
34.Access to an IIS server is required to create an ASP.NET application.
Answer: TrueLevel: Moderate
Section: 12-4Page: 328
35.Web controls are located in a menu called WebTools.
Answer: FalseLevel: Moderate
Section: 12-4Page: 330
36.The properties for a web textbox control are identical to a window textbox control.
Answer: FalseLevel: Hard
Section: 12-4Page: 330
37.The file that holds the event code for a web form must be written in Visual Basic.
Answer: FalseLevel: Moderate
Section: 12-4Page: 331
38.Web applications should be created when processing needs to be done on the local machine.
Answer: FalseLevel: Moderate
Section: 12-4Page: 332
39.A Windows application is an example of a thin front-end application.
Answer: FalseLevel: Moderate
Section: 12-4Page: 332
40.The design of a project should always precede the implementation phase.
Answer: TrueLevel: Moderate
Section: 12-4Page: 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: dLevel: Easy
Section: 12-1Page: 320
42.Which symbol is used to enclose HTML tags?
a.) ( )
b.) < >
c.) [ ]
d.) { }
e.) None of the above.
Answer: b Level: Easy
Section: 12-1 Page: 320
43.Which symbol identifies an HTML end tag?
a.) !
b.) |
c.) /
d.) \
e.) ?
Answer: cLevel: Moderate
Section: 12-1 Page: 320
44.Which HTML tag does not use an end tag?
a.) B
b.) center
c.) HR
d.) I
e.) U
Answer: cLevel: Moderate
Section: 12-1 Page: 321
45.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 Level: Moderate
Section: 12-1 Page: 321
46.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 Level: Hard
Section: 12-1 Page: 321
47.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 Level: Easy
Section: 12-2 Page: 322
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: bLevel: Moderate
Section: 12-2 Page: 322
49.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: dLevel: Hard
Section: 12-2 Page: 322
50.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 Level: Easy
Section: 12-2 Page: 323
51.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: dLevel: Moderate
Section: 12-2 Page: 323
52.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: bLevel: Hard
Section: 12-2 Page: 323
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 Level: Moderate
Section: 12-3 Page: 324
54.Which set of symbols are used to signify the presence of ASP.NET code?
a.) <@
b.) <#
c.) <$
d.) <%
e.) &
Answer: d Level: Moderate
Section: 12-3 Page: 324
55.Which is the file extension used for an ASP.NET file?
a.) asn
b.) asp
c.) aspn
d.) aspx
e.) asx
Answer: d Level: Easy
Section: 12-3 Page: 325
56.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: dLevel: Moderate
Section: 12-3 Page: 326
57.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 Level: Easy
Section: 12-4 Page: 327
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: dLevel: Easy
Section: 12-4 Page: 327
59.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 Level: Moderate
Section: 12-4 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: bLevel: 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 Level: Moderate
Section: 12-4Page: 330
62.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 Level: Moderate
Section: 12-4 Page: 331
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 Level: Moderate
Section: 12-4 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 Page: 322
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 ___
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
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 ___
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.
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 - 1