PrepAway - Latest Free Exam Questions & Answers

Category: 70-515

Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4

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?

What should you do?

You are implementing an ASP.NET Web application that retrieves data from a Microsoft SQL Server database.
You add a page that includes the following data source control.

<asp:SqlDataSource id=”sqlds” runat=”server” ConnectionString=”<%$ ConnectionStrings:MyDB %>” SelectCommand=”SELECT * FROM Companies” />

The page is accessed frequently, but the data in the database rarely changes.
You need to cache the retrieved data so that the database is not queried each time the Web page is accessed.
What should you do?

What should you do?

You are implementing an ASP.NET page.
You add and configure the following ObjectDataSource.

<asp:ObjectDataSource SelectMethod=”GetProductByProductId” ID=”odc” runat=”server” TypeName=”ProductDAL”>
<SelectParameters>
<asp:Parameter Name=”productId” Type=”Int32″ />
</SelectParameters>
</asp:ObjectDataSource>

The page will be called with a query string field named pid.
You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method.
What should you do?

Which configuration should you use in web.config?

You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations.
Each location will specify its SMTP configuration settings in a separate file named smtp.config in the root folder of the Web site.
You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the Web site.
Which configuration should you use in web.config?

Which two actions should you perform?

You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project.
The service includes a method named GetPeople that takes no arguments and returns an array of Person objects.
The ASP.NET application uses a proxy class to access the service.
You use the Add Service Reference wizard to generate the class.
After you create the proxy, you move the service endpoint to a different port.
You need to configure the client to use the new service address.
In addition, you must change the implementation so that calls to the client proxy will return a List<Person> instead of an array.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Which code segment should you use?

You are implementing an ASP.NET Web site.
The site uses a component that must be dynamically configured before it can be used within site pages.
You create a static method named SiteHelper.Configure that configures the component.
You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested.
Which code segment should you use?

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?


Page 9 of 11« First...7891011