PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you use?

A Web service returns a list of system users in the following format.
<?xml version=”1.0″ ?>
<users>
<user id=”first”>
<name>Name of first user</name>
<email>first@contoso.com</email>
</user>
<user id=”second”>
<name>Name of second user</name>
<email>second @contoso.com</email>
</user>
</users>
You need to populate a drop-down menu with the IDs and names of the users from the Web service,
in the order provided by the service. Which code segment should you use?

You need to configure the panels to meet the requirements

You are implementing an ASP.NET AJAX page. You add two UpdatePanel controls named pnlA and
pnlB. pnlA contains an UpdatePanel control named pnlAInner in its content template. You have the
following requirements. Update panels pnlA and pnlB must refresh their content only when controls

that they contain cause a postback. Update panel pnlAInner must refresh its content when controls
in either pnlA or pnlB or pnlAInner cause a postback. You need to configure the panels to meet the
requirements. What should you do?

You need to ensure that all clients calling GetMessage will retrieve the updated string if the message is upda

A Windows Communication Foundation (WCF) solution uses the following contract to share
a message across its clients. (Line numbers are included for reference only.) The code for
the service class is as follows. The service is self-hosted. The hosting code is as follows.
You need to ensure that all clients calling GetMessage will retrieve the updated string if the
message is updated by any client calling PutMessage. What should you do?

What are two possible ways to achieve this goal?

A WCF service code is implemented as follows. (Line numbers are included for reference
only.) 01 [ServiceContract] 02 [ServiceBehavior(InstanceContextMode = 03
InstanceConcextMode.Single)] 04 public class CalculatorService 05 { 06
[OperacionContract] 07 public double Calculate(double opl, string op, double op2) 08 { …
24 } 25 } You need to decrease the response time of the service. What are two possible
ways to achieve this goal? (Each correct answer presents a complete solution. Choose
two.)

Which code segment should you add at line 06?

You are developing an ASP.NET Web page.
The page contains the following markup.
<asp:GridView ID=”gvModels” runat=”server”
onrowdatabound=”gvModels_RowDataBound”
AutoGenerateColumns=”false”>
<Columns>
<asp:BoundField DataField=”Name” HeaderText=”Model” />
<asp:TemplateField>

<ItemTemplate>
<asp:Image ID=”img” runat=”server” />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
The pages code-behind file includes the following code segment. (Line numbers are included for
reference only.)
01 protected void gvModels_RowDataBound(object sender,
GridViewRowEventArgs e)
02 {
03 if (e.Row.RowType == DataControlRowType.DataRow)
04 {
05 CarModel cm = (CarModel)e.Row.DataItem;
06
07 img.ImageUrl = String.Format(“images/{0}.jpg”,
cm.ID);
08
09 }
10 }
You need to get a reference to the Image named img. Which code segment should you add at line
06?