Name: 
 

CS 450 Review 1



Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 1. 

Unlike a static web page, a dynamic web page
a.
is created in response to an HTTP request
b.
is defined by a web form
c.
consists of HTML
d.
can’t be displayed in a web browser
 

 2. 

An HTTP response contains
a.
the address of the browser
b.
the HTML document
c.
the address of the browser and the HTML document
d.
the address of the browser, the HTML document, and ASP tags
 

 3. 

When a dynamic web page is requested, the web server passes the request to
a.
the operating system
c.
the web application
b.
the browser
d.
the application server
 

 4. 

HTTP is known as a stateless protocol because
a.
after an application generates a web page, the data for the page is discarded
b.
after the web page generated by an application is returned to the client in an HTTP response, the session ends
c.
the browser that sends an HTTP request for an application has no way of knowing what server was used to process previous requests for the application
d.
the server that receives an HTTP request for a web page has no way to associate the browser that sent the request with its previous requests
 

 5. 

To maintain the state of an application, ASP.NET provides
a.
view state and session state
c.
application state
b.
profiles
d.
all of the above
 

 6. 

The file that contains the HTML code for a web form is the
a.
code-behind file
c.
assembly file
b.
aspx file
d.
DLL file
 

 7. 

The component of the .NET Framework that manages the execution of .NET programs is the
a.
Visual Studio .NET compiler
c.
Common Language Runtime (CLR)
b.
Common Type System
d.
Operating System
 

 8. 

The main purpose of the .NET Framework Class Library is to
a.
provide the classes that are used for developing .NET applications
b.
provide the classes that are needed for developing database applications
c.
manage the execution of .NET applications
d.
manage the development of the web pages
 

 9. 

To develop ASP.NET applications in a local area network development environment, you must have all but one of the following installed on the server. Which one is it?
a.
Windows 2003 Server or later
c.
IIS 6.0 or later
b.
the .NET Framework
d.
Visual Studio .NET
 

 10. 

Which part of the following URL identifies the server that’s hosting the web site?
http://localhost/MainStore/Hours.aspx
a.
http
c.
MainStore
b.
localhost
d.
Hours.aspx
 

 11. 

When you design a form, you use the
a.
Web Forms Designer, Code Editor, and Solution Explorer
b.
Web Forms Designer and Code Editor
c.
Web Forms Designer, Code Editor, and Properties window
d.
Web Forms Designer, Toolbox, and Properties window
 

 12. 

If you set the AutoPostBack property of a control to True, the page is posted back to the server
a.
only if the IsPostBack property of the page is set to True
b.
whenever the value of the control changes
c.
when the value of the control changes, but only if view state is enabled for the control
d.
when you change the value of the control and then click a button control
 

 13. 

If you change the value of a control property in code and you want the property returned to its initial value each time the page is loaded, you should
a.
enable view state for the control
b.
disable view state for the control
c.
enable view state for the control and the page that contains it
d.
disable view state for the control and the page that contains it
 

 14. 

You can display a form in the Web Forms Designer in all but one of the following views. Which one is it?
a.
Design
c.
Split
b.
HTML
d.
Source
 

 15. 

The Load event of a page occurs
a.
every time the page is loaded
b.
only the first time the page is loaded
c.
only if the value of one or more controls on the page have changed
d.
only if none of the values of the controls on the page have changed
 

 16. 

Which event occurs when you select an item from a drop-down list?
a.
Click
c.
CheckedChanged
b.
TextChanged
d.
SelectedIndexChanged
 

 17. 

View state data is stored
a.
in a hidden input field in the HTML for the page
b.
in the HTML for the control
c.
in a temporary file on the web server
d.
in browser memory
 

 18. 

The values that a user enters into a control on a page are returned to the browser
a.
in a hidden input field in the HTML for the page
b.
in the HTML for the control
c.
in an encrypted field within the HTML
d.
in an attached text file
 

 19. 

Which of the following isn’t true for validation controls?
a.
The validation is done on the client if DHTML is supported by the browser.
c.
You can use the IsValid property to test whether the validation failed.
b.
The validation is always done on the server.
d.
The validation isn’t done if the form’s IsPostBack property is set to False.
 

 20. 

Which of the following isn’t true for web server controls?
a.
Web server controls are always processed on the server.
c.
All web server controls have a CausesValidation property.
b.
To align web server controls, you can store the controls in the cells of a table.
d.
Web server controls are rendered as HTML with no asp tags.
 

 21. 

Which of the following isn’t a valid way to start an event procedure?
a.
double-click on a form in the Web Forms Designer
c.
Select a control and double-click on an event in the Properties window
b.
double-click on a validation control in the Web Forms Designer
d.
Select a control from the top left of the Code Editor and an event from the top right
 

 22. 

All but one of these statements about the Transfer method of the HttpServerUtility class is true. Which one is false?
a.
This method involves a round trip to the browser.
b.
The processing for this method takes place on the server.
c.
This method is typically used only if performance is critical.
d.
This method does not affect session state.
 

 23. 

Consider the following statement. What directory does the page reside in?
Response.Redirect("Secure/IncomeStatement.aspx")
a.
The Secure subdirectory of the host’s root directory
b.
The Secure subdirectory of the current directory
c.
The Secure directory at the same level in the directory structure as the current directory
d.
The Secure directory one level up from the current directory
 

 24. 

Consider the following statement. What directory does the page reside in?
Response.Redirect("../Secure/IncomeStatement.aspx")
a.
The Secure subdirectory of the host’s root directory
b.
The Secure subdirectory of the current directory
c.
The Secure directory at the same level in the directory structure as the current directory
d.
The Secure directory one level up from the current directory
 

 25. 

Session state is typically used for all but one of the following purposes. Which one is it?
a.
To keep information about the user
b.
To save objects that a user is working with
c.
To keep track of pending operations
d.
To keep track of the last web page that was requested
 

 26. 

When a browser requests a web page, ASP.NET
a.
creates a session state object that keeps track of the user entries
b.
creates a session state object that contains an ID for the session
c.
creates a session state object that the application can store a session ID in
d.
does none of the above
 

 27. 

By default, ASP.NET sends the session ID to the browser in
a.
a cookie
c.
the session state object
b.
the URL
d.
a text file
 

 28. 

When you use the Solution Explorer to rename a web form file, Visual Studio
a.
changes the class name for the form in the code-behind file
b.
changes the Inherits attribute of the Page directive in the aspx file
c.
changes all references to the class name in the Visual Basic code
d.
doesn’t change the class name for the form
 

 29. 

If  you don’t need to retrieve data from the original web page, which is the best way to transfer control to a new page?
a.
the Server.Transfer method
c.
cross-page posting
b.
the Response.Redirect method
d.
no method is clearly the best
 

 30. 

Which statement best describes the operation of the following code?
If Not IsPostBack Then
    ddlProducts.DataBind()
End If
a.
If the page is being requested for the first time, bind a drop-down list to a data source.
b.
If the page isn’t being requested for the first time, bind a drop-down list to a data source.
c.
If the page is being requested for the first time, bind a data source to a drop-down list.
d.
If the page isn’t being requested for the first time, bind a data source to a drop-down list
 

 31. 

Assuming that cart is a SortedList object, which statement best describes the operation of the following code?
Dim cartItem As CartItem
For Each cartEntry As DictionaryEntry In cart
    CartItem = CType(cartEntry.Value, CartItem)
    lstCart.Items.Add(cartItem.Display)
Next
a.
Each DictionaryEntry object in the cart object is stored in a CartItem object and added to a list box control.
b.
The value of each DictionaryEntry object in the cart object is stored in a CartItem object and added to a list box control.
c.
The value of each DictionaryEntry object in the cart object is stored in a CartItem object, and the data returned from the object’s Display method is added to a list box.
d.
The key and value of each DictionaryEntry object in the cart object is stored in a CartItem object, and the data returned from the object’s Display method is added to a list box.
 

 32. 

To test a web site from outside Visual Studio, you need to
a.
start the browser you want to use, enter the URL of the starting page of the web site, and press Enter.
b.
find the web site in the Windows Explorer, select it, and press Enter.
c.
start the browser you want to use, enter the URL for root directory of the web site, and press Enter.
d.
find the web site in the Windows Explorer, and double-click on it.
 

 33. 

The primary use of the Autos, Locals, and Watch windows is to
a.
get information about the statements that are being used
b.
review or change the data in the variables and properties that are being used
c.
review or change an expression that’s being used
d.
re-run a Sub or Function procedure that’s being used
 

 34. 

Most HTML elements have all but one of the following parts. Which one is it?
a.
A start tag
c.
Comments
b.
An end tag
d.
Content
 

 35. 

How do you force a line break at a specific location within literal text?
a.
Add a Br element where you want the line break to occur
b.
Add a P element where you want the line break to occur
c.
Type   where  you want the line break to occur
d.
None of the above
 

 36. 

The basic appearance of the text in an HTML document is determined by
a.
your application
c.
ASP.NET
b.
the browser
d.
IIS
 

 37. 

The Table element provides attributes that let you control
a.
the vertical alignment of the contents of a row
b.
the horizontal alignment of the contents of a cell
c.
the vertical alignment of the contents of a cell
d.
the appearance of the boundary of the table
 

 38. 

Suppose you want to create a table like this:
 
   
   
To make the cell in the first row the same width as all three columns in the other rows, you set the
a.
Colspan attribute of the row to 3
c.
Colspan attribute of the cell to 3
b.
Rowspan attribute of the column to 3
d.
Rowspan attribute of the cell to 3
 

 39. 

You typically use inline styles to format
a.
the text in an element of a web form
b.
the text that’s displayed in a control on a form
c.
the text in just a portion of an element
d.
an external style sheet
 

 40. 

To define the styles in an external style sheet, you use
a.
the Format attribute
c.
style rules
b.
the Style attribute
d.
style classes
 

 41. 

An internal style sheet can contain
a.
style classes
c.
both a and b
b.
element-based styles
d.
neither a nor b
 

 42. 

A regular style class is a class that
a.
is pre-defined
b.
defines a style rule that can only be used with the Anchor element
c.
is applied by naming it on the Class attribute of an element
d.
is applied when the condition it specifies occurs
 

 43. 

A dynamic pseudo-class is a class that
a.
can be used only with the Anchor element
b.
can be used only with the element specified in its definition
c.
is applied by naming it on the Class attribute of an element
d.
is applied when the condition it specifies occurs
 

 44. 

The new CSS Properties window is most useful for
a.
modifying the styles for an element
c.
applying a style to elements or text
b.
moving styles between an internal and an external style sheet
d.
creating and modifying styles
 

 45. 

Web server controls must be rendered as standard HTML so they can be interpreted by
a.
ASP.NET
b.
IIS
c.
the operating system on the client machine
d.
the browser on the client machine
 

 46. 

To use the styles in an external style sheet,
a.
you use the Style attribute of a document head to identify the style sheet
b.
you use the Link element of a document head to identify the style sheet
c.
you use the Style attribute of an element to identify a specific style rule
d.
you use the Link attribute of an element to identify the style sheet
 

 47. 

Table formatting is commonly used to format web pages because table formatting lets you
a.
use internal styles to format the elements within the table
b.
use external style sheets to format the elements within the table
c.
control the layout of a web page when you’re using flow layout
d.
control the way various types of browser windows work
 

 48. 

Which of the following can’t you do if you code an event handler with a Handles clause?
a.
give it any name you want
b.
name it in an event attribute of a control
c.
declare it with Private scope
d.
use it to handle more than one event
 

 49. 

When the user clicks a button, link button, or image button control, the page is posted back to the server and
a.
the Click event is raised
b.
the Command event is raised
c.
both the Click and Command events are raised
d.
the Click event is raised and the Command event is raised if a value is specified for the CommandName or CommandArgument attribute of the control
 

 50. 

You can use the X and Y properties of the ImageClickEventArgs class to determine
a.
where the user clicked on an image control
b.
where the user clicked on an image button control
c.
which image the user clicked on in a group of image controls
d.
which button the user clicked on in a group of image button controls
 

 51. 

You typically use the CommandName property of the CommandEventArgs class to
a.
determine what event should be raised when a button control is clicked
b.
get the name of the last event that was executed along with the argument values that were passed to it
c.
determine how the application should respond when the user clicks a button in a group of related buttons
d.
set the CommandName and CommandArgument attributes of the button the user clicked
 

 52. 

Which of the following statements would you use to get the value of the item that’s selected in a list box named lstMonth?
a.
lstMonth.Items.Selected
c.
lstMonth.Selected.Value
b.
lstMonth.Items.Selected.Value
d.
lstMonth.SelectedItem.Value
 

 53. 

You should assign different values to the Text and Value properties of a list item if you want to
a.
assign an index value to the item
b.
assign a key value to the item
c.
store a different value for the list item than the one that’s displayed
d.
none of the above
 

 54. 

Which of the following techniques can you use to load items into a drop-down list?
a.
Use the Add method of the list item collection to add an item with the specified Text property at the end of the collection
b.
Use the Add method of the list item collection to add an item with the specified Value property at the end of the collection
c.
Use the Add method of the list item collection to add an item with the specified Text and Value properties at the end of the collection
d.
Use the Add method with an index argument to add an item with the specified Text at the index location in the collection
 

 55. 

You typically use the ListItem Collection Editor to add items to a list
a.
if the Text and Value properties of the list items are the same
b.
if the Text and Value properties of the list items are different
c.
if the list items won’t change
d.
if the list items change frequently
 

 56. 

To determine if an item in a check box list is selected, you
a.
refer to the item by its name and test its Selected property
b.
refer to the item by its index value and test its Selected property
c.
test the list’s SelectedValue property
d.
use the list’s CheckedChanged event
 

 57. 

The main difference between buttons, link buttons, and image buttons is
a.
the way the CausesValidation attribute works
b.
the way the CommandName attribute works
c.
the way the controls are displayed on a form
d.
the events that are fired when a control is clicked
 

 58. 

To determine if an item in a radio button list is selected, you
a.
refer to the item by its name and test its Selected property
b.
refer to the item by its index value and test its Selected property
c.
test the list’s SelectedValue property
d.
use the list’s CheckedChanged event
 

 59. 

To set the focus to a specific control when a form is first displayed, you
a.
set the DefaultFocus attribute for the control to True
b.
set the DefaultFocus attribute for the form to the name of the control
c.
use the SetDefaultFocus method for the form in the event handler for its Load event
d.
use the Focus method for the form to set the focus to the control
 

 60. 

Which statement best describes the aspx code for the bulleted list that follows?

<asp:BulletedList ID="BulletedList2" runat="server" BulletStyle="Numbered"
    DisplayMode="HyperLink">
    <asp:ListItem Value="Costumes.aspx">Costumes</asp:ListItem>
    <asp:ListItem Value="StaticProps.aspx">Static props</asp:ListItem>
    <asp:ListItem Value="AnimatedProps.aspx">Animated props</asp:ListItem>
</asp:BulletedList>
a.
The bulleted list describes three numbered categories of products.
b.
The bulleted list describes three numbered categories of products and gives starting values to each of them.
c.
When the user clicks on one of the numbered categories, the corresponding value will be available from the event handler for the list.
d.
When the user clicks on one of the numbered categories, the web application will be transferred to the page that’s specified in the Value attribute.
 



 
Check Your Work     Start Over