WorksheetsC# Chapter 4
Total questions: 10
Worksheet time: 9mins
You write the following code for your Web page.
What would be the style for text displayed as part of the
element?
Font family: Verdana; font weight: bold; font size: 12pt
Font family: Verdana; font weight: bold; font size: 9pt
Font family: Verdana; font size: 12pt
Font family: Verdana; font size: 9pt
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 need to install additional plug-ins in order to use your Web site. Which of the following technologies should you use to display maps?
HTML
Server-side programming technology such as ASP.NET
Adobe Flash
JavaScript
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?
Query strings
Cookies
ViewState
Session
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?
Cookies
ViewState
ViewState with encryption
Session
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?
In the PreInit event handler of the Page class
In the Init event handler of the Page class
In the Load event handler of the Page class
In the PreRender event handler of the Page class
You want to display values of the C# expressions in an ASP.NET page. Which of the following types of code blocks should you use to enclose the expression?
<script runat="server">...</script>
<script>...</script>
<%=…%>
<form>...</form>
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?
.NET Framework Redistributable
.NET Framework Software Development Kit
Visual Studio
A Web browser
Your client application calls for 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?
You should install a better processor on the Web server.
You should install a better processor on the client computer.
You should upgrade to a faster Internet connection.
You should use asynchronous calls to invoke the Web service.
You have created an ASP.NET Web service that converts one currency into another. One of the methods in your Web service is defined with the following code. The users of the Web service report that they can set a reference to the Web service but the Convert method is not available to them. What could be the problem?
The .asmx file for the Web service is not available on the Web server.
The Web service class is not marked with the WebService attribute.
The Convert method is not marked with the WebMethod attribute.
Web services can only expose methods that return text values.
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?
The Web service project
The client project that accesses the Web service
Both the client project and the Web service project
Neither the client project nor the Web service project
