PrepAway - Latest Free Exam Questions & Answers

Category: 70-515 (v.3)

Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4 (update October 26th, 2015)

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.)

You need to ensure that the connection string value that is stored in the web.config file is updated to the pr

You are preparing to deploy an ASP.NET application to a production server by publishing the
application in Release configuration. You need to ensure that the connection string value that is
stored in the web.config file is updated to the production server# s connection string value during
publishing. What should you do?

You need to cache the retrieved data so that the database is not queried each time the Web page is accessed

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?

Which code segment should you use?

You are implementing an ASP.NET application that uses LINQ to Entities to access and update the
database. The application includes the following method to update a detached entity of type Person.
private NorthwindContext _entities;
public void UpdatePerson(Person personToEdit)
{}
You need to implement the UpdatePerson method to update the database row that corresponds to
the personToEdit object. Which code segment should you use?

Which two actions should you perform?

You are implementing an ASP.NET Web site. The Web site contains a Web service named
ProductService . The code-behind file for the ProductService class contains the following code
segment.
public class ProductService :
System.Web.Services.WebService
{
public List<Product> GetProducts( int categoryID )
{
return GetProductsFromDatabase(categoryID);
}}
You need to ensure that the GetProducts method can be called by using AJAX. Which two actions
should you perform? (Each correct answer presents part of the solution. Choose two.)

You need to ensure that the About action is invoked when the root URL of the site is accessed

You create a new ASP.NET MVC 2 Web application. The following default routes are created in the
Global.asax.cs file. (Line numbers are included for reference only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
04
05 routes.MapRoute( “Default”, “{controller}/{action}/{id}”, new { controller = “Home”, action =
“Index”, id = “” } );
06 }
You implement a controller named HomeController that includes methods with the following
signatures.
public ActionResult About()
public ActionResult Index()
public ActionResult Details(int id)
You need to ensure that the About action is invoked when the root URL of the site is accessed. What
should you do?

You need to ensure that requests for this URL that contain an unrecognized country value will not be processed

You are implementing an ASP.NET MVC 2 Web application. The URL with path
/Home/Details/{country} will return a page that provides information about the named country. You
need to ensure that requests for this URL that contain an unrecognized country value will not be
processed by the Details action of HomeController. What should you do?

What are two possible ways to achieve this goal?

You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code.
public ActionResult Edit(int id)
{
return View(SelectUserToEdit(id));
}
public ActionResult Edit(Person person)
{
UpdateUser(person);
return RedirectToAction(“Index”);
}
The first Edit action displays the user whose details are to be edited, and the second Edit action is
called when the Save button on the editing form is clicked to update the user details. An exception is
thrown at run time stating that the request for action Edit is ambiguous. You need to correct this
error and ensure that the controller functions as expected. What are two possible ways to achieve
this goal? (Each correct answer presents a complete solution. Choose two.)


Page 13 of 26« First...1112131415...20...Last »