Which code segment should you use?
You need to ensure that the JavaScript for each of these controls that is used in an ASP.NET page…
You are implementing custom ASP.NET server controls. You have a base class named
RotaryGaugeControl and two subclasses named CompassGaugeControl and SpeedGaugeControl.
Each control requires its own client JavaScript code in order to function properly. The JavaScript
includes functions that are used to create the proper HTML elements for the control. You need to
ensure that the JavaScript for each of these controls that is used in an ASP.NET page is included in
the generated HTML page only once, even if the ASP.NET page uses multiple instances of the given
control. What should you do?
Which code segment should you use?
You are implementing an ASP.NET application. You add the following code segment.
Public Function GetNonSecretUsers() As List(Of Person)
Dim secretUsers() As String =
{“@secretUser”, “@admin”, “@root”}
Dim allpeople As List(Of Person) = GetAllPeople()
…
End Function
You need to add code to return a list of all Person objects except those with a UserId that is
contained in the secretUsers list. The resulting list must not contain duplicates. Which code segment
should you use?
Which code segment should you use?
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format r
You are implementing an ASP.NET Web site. The site contains the following class.
public class Address
{
public int AddressType;
public string Line1;
public string Line2;
public string City;
public string ZipPostalCode;
}
The Web site interacts with an external data service that requires Address instances to be given in
the following XML format.
<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<PostalCode>60603</PostalCode>
</Address>
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the
XML format requirements of the external data service. Which two actions should you perform (Each
correct answer presents part of the solution. Choose two.)
Which two actions should you perform?
You are implementing a new Dynamic Data Web site. The Web site includes a Web page that has an
ObjectDataSource control named ObjectDataSource1. ObjectDataSource1 interacts with a Web
service that exposes methods for listing and editing instances of a cla named Product. You add a
GridView control named GridView1 to the page, and you specify that GridView1 should use
ObjectDataSource1 as its data source. You then configure GridView1 to auto-generate fields and to
enable editing. You need to add Dynamic Data behavior to GridView1. You also must ensure that
users can use GridView1 to update Product instances. Which two actions should you perform? (Each
correct answer presents part of the solution. Choose two.)
Which code segment should you use?
You are developing a new version of an existing message contract named
CustomerDetailsVersion1. The new version of the message contract must add a
Department field of type String to the SOAP header. You create a new class named
GustomerDetailsVersion2 that inherits from CustomerDetailsVersion1. You need to ensure
that all client applications can consume the service. Which code segment should you use?
What are two possible attributes that you can add to the Edit action to achieve this goal?
You are implementing an ASP.NET MVC 2 Web application that allows users to view and edit data.
You need to ensure that only logged-in users can access the Edit action of the controller. What are
two possible attributes that you can add to the Edit action to achieve this goal? (Each correct answer
presents a complete solution. Choose two.)
Which code segment should you use?
You create an ASP.NET MVC 2 Web application. You implement a single project area in the
application. In the Areas folder, you add a subfolder named Test. You add files named
TestController.cs and Details.aspx to the appropriate subfolders. You register the area’s route,
setting the route name to test_default and the area name to test. You create a view named Info.aspx
that is outside the test are A. You need to add a link to Info.aspx that points to Details. aspx. Which
code segment should you use?
What should you add to the service configuration file?
You are developing a Windows Communication Foundation (WCF) service. You establish
that the largest size of valid messages is 8,000 bytes. You notice that many malformed
messages are being transmitted. Detailed information about whether each message is
malformed must be logged. You need to ensure that this information is saved in XML format
so that it can be easily analyzed. What should you add to the service configuration file?