Which code segment should you use?
You are creating an ASP.NET Web site. You create a HTTP module named CustomModule, and you
register the module in the web.config file. The CustomModule class contains the following code.
public class CustomModule : IHttpModule
{
string footerContent = “<div>Footer Content</div>”;
public void Dispose( ) {}
}
You need to add code to CustomModule to append the footer content to each processed ASP.NET
page.
Which code segment should you use?
Which method of the FieldTemplateUserControl class should you override in the BooleanField class?
You are developing an ASP.NET Dynamic Data Web application. Boolean fields must display as Yes or
No instead of as a check box. You replace the markup in the default Boolean field template with the
following markup.
<asp:Label runat=”server” ID=”label” />
You need to implement the code that displays Yes or No. Which method of the
FieldTemplateUserControl class should you override in the BooleanField class?
You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductI
Which code segment should you use?
You are implementing an ASP.NET page. Client-side script requires datA. Your application includes a
class named Person with a Name property of type string. The code-behind file of the page includes
the following code segment.
public string JsonValue;
List<Person> people = GetPeopleList();
JavaScriptSerializer json = new JavaScriptSerializer();
You need to use the JavaScriptSerializer class to serialize only the Name property of each item in the
people list. Which code segment should you use?
Which interface should you add the extension method to?
You are developing an ASP.NET Web page that will display the median value from a sequence of
integer values. You need to create an extension method to compute the median value. Which
interface should you add the extension method to?
You need to display the items in a table named Products by using a custom layout
You are implementing an ASP.NET Dynamic Data Web site. The Web site includes a data context that
enables automatic scaffolding for all tables in the data model. The Global.asax.cs file contains the
following code segment.
public static void RegisterRoutes(RouteCollection routes) {
{
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.List,
ViewName = “ListDetails”,
Model = DefaultModel
});
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.Details,
ViewName = “ListDetails”,
Model = DefaultModel
});
}
You need to display the items in a table named Products by using a custom layout. What should you
do?
You need to ensure that the GetCurrentRate method can be called from JavaScript
Which code segment should you use?
You are implementing an ASP.NET page. The page includes a method named
GetCustomerOrderDataSet that returns a DataSet. The DataSet includes a DataTable named
CustomerDetailsTable and a DataTable named OrderDetailsTable. You need to display the data in
OrderDetailsTable in a DetailsView control named dtlView. Which code segment should you use?
Which two actions should you perform?
You are developing an ASP.NET Web service. The following code segment implements the service.
(Line numbers are included for reference only.)
01 [WebServiceBinding(ConformsTo =
WsiProfiles.BasicProfile1_1)]
02 public class ProductService :
System.Web.Services.WebService
03 {
04 [WebMethod]
05 public Product GetProduct(string name)
06 {
07
08 }
09
10 [WebMethod]
11 public Product GetProduct(int id)
12 {
13
14 }
15 }
You need to ensure that both GetProduct methods can be called from a Web client. Which two
actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Which FormView property should you set in the code-behind file?
You are developing an ASP.NET Web page. The page includes a List<Product> instance. You add a
FormView control to display a single Product from this list. You need to bind the list to the FormView
control. Which FormView property should you set in the code-behind file?