The latest 70-515 exam was updated with a lot of new exam questions, old version 70-515 exam dumps are not valid at all, you should get the newest 299q 70-515 practice tests or braindumps to prepare it. Now, PassLeader just published the new 70-515 exam questions with PDF dumps and VCE test software, which have been corrected with many new questions and will help you passing 70-515 exam easily. Visit www.passleader.com now and get the premium 299q 70-515 exam dumps with new version VCE Player for free download.

QUESTION 21You 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?

QUESTION 22You deploy an ASP.NET application to an IIS server. You need to log health-monitoring events with severity level of error to the Windows application event log. What should you do?

A. Run the aspnet_regiis.exe command.B. Set the Treat warnings as errors option to All in the project properties and recompile.C. Add the following rule to the <healthMonitoring/> section of the web.config file.<rules><add name=”Failures” eventName=”Failure Audits” provider=”EventLogProvider” /></rules>D. Add the following rule to the <healthMonitoring/> section of the web.config file.<rules><add name=”Errors” eventName=”All Errors” provider=”EventLogProvider” /></rules>

Answer: D

QUESTION 23You are developing an ASP.Net web application. The application includes a master page named CustomerMaster.master that contains a public string property name EmployeeName application also includes a second master page named NestedMaster.master that is defined by the following directive.<%@ Master Language=”C#”MasterPageFile=”~/CustomMaster.Master”CodeBehind=”NestedMaster.Master.cs”Inherits=”MyApp.NestedMaster”%>You add a content page that uses the NestedMaster.master page file. The content page contains a label control named lblEmployeeName. You need to acces the EmployeeName value and display the value within the lblEmployeeName label. What should you do?

A. Add the following code segment to the code-behind file of the content page.public void Page_load(object s, EventArgs e){lblEmployeeName.text=((MyApp.CustomMaster)Page.Master.Parent).EmployeeName;}B. Add the following directive to the content page.<%@ MasterTypeVirtualPAth=”~/CustomMaster.master” %>Add the following code segment to the code-behind file of the content page.public void Page_load(object s, EventArgs e){lblEmployeeName.text=this.Master.EmployeeName;}C. Add the following code segment to the code-behind file of the content page.public void Page_load(object s, EventArgs e){lblEmployeeName.text=((MyApp.CustomerMaster)Page.Master.Master).EmployeeName;}D. Add the following code segment to the code-behind file of the content page.public void Page_load(object s, EventArgs e){lblEmployeeName.text=((MyApp.CustomerMaster)Page.Master.Master).FindControl(“EmployeeName”).toString();}

Answer: A

QUESTION 24You´re developing an ASP web page. The pages requires access to types that are defined in an assembly named Contoso.businessobjects.dll. You need to ensure that the page can access these types.

QUESTION 25You are developing an ASP.NET web page. The page includes functionality to make a web request and to display the responde in a specified HTML element. You need to add a client-side function to write the response to the specified HTML element. Which function should you add?

QUESTION 26You are perfoming security testing on an existing asp.net web page. You notice that you are able to issue unauthorized postback requests to the page. You need to prevent unauthorized post back requests. which page directive you use?

QUESTION 27You are developing an ASP.NET web application. Your designer creates a theme named General for general use in the application. The designer also makes page-specific changes to the default properties of certain controls. You need to apply the General theme to all pages, and you must ensure that the page-specific customizations are preserved. What should you do?

A. Add the following configuration to the web.config file.<configuration><system.web><pages theme=”General”/></system.web></configuration>Set the following page directive on pages that have customizations.<%@ Page EnableTheming=”true” %>B. Add the following configuration to the web.config file.<configuration><system.web><pages styleSheetTheme=”General”/></system.web></configuration>C. Add the following configuration to the web.config file.<configuration><system.web><pages theme=”General”/></system.web></configuration>Set the following page directive on pages that have customizations.<%@ Page StyleSheetTheme=”General” %>D. Add the following configuration to the web.config file.<configuration><system.web><pages theme=”General”/></system.web></configuration>Set the following page directive on pages that have customizations.<%@ Page EnableTheming=”false” %>

Answer: D

QUESTION 28You are implementing an ASP.NET application. You add the following code segment.public List<Person> GetNonSecretUsers(){string[] secretUsers = {“@secretUser”, “@admin”, “@root”};List<Person> allpeople = GetAllPeople();…}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?

QUESTION 29You are implementing an ASP.NET Web site. The Web site contains a Web service named CustomerService. The code-behind file for the CustomerService 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.)

A. Apply the WebService attribute to the ProductService class.B. Apply the ScriptService attribute to the ProductService class.C. Apply the WebMethod attribute to the GetProducts method.D. Apply the ScriptMethod attribute to the GetProducts method.

Answer: BC

QUESTION 30You are implementing a WCF service library. You add a new code file that contains the following code segment.namespace ContosoWCF{[ServiceContract]public interface IRateService{[OperationContract]decimal GetCurrentRate();}public partial class RateService : IRateService{public decimal GetCurrentRate(){decimal currentRate = GetRateFromDatabase();return currentRate;}}}You build the service library and deploy its assembly to an IIS application. You need to ensure that the GetCurrentRate method can be called from JavaScript. What should you do?

A. Add a file named Service.svc to the IIS application.Add the following code segment to the file.<%@ ServiceHost Service=”ContosoWCF.IRateService” Factory=”System.ServiceModel.Activation.WebScriptServiceHostFactory” %>B. Add a file named Service.svc to the IIS application.Add the following code segment to the file.<%@ ServiceHost Service=”ContosoWCF.RateService” Factory=”System.ServiceModel.Activation.WebScriptServiceHostFactory” %>C. Apply the script service attribute to rate serice class Rebulid the WCF servicelibrary, and redploy the assembly to the IIS application.D. Apply the Web get attibute to the Get Currant rate interface Method.Rebuild the WCF servicelibrary, and redploy the assembly to the IIS application.

QUESTION 31You 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><ZipCode>60603</ZipCode></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.)

A. Add the following attribute to the AddressType field.[XmlAttribute]B. Add the following attribute to the Line2 field.[XmlElement(IsNullable=true)]C. Add the following attribute to the ZipPostalCode field.[XmlAttribute(“ZipCode”)]D. Add the following attribute to the ZipPostalCode field.[XmlElement(“ZipCode”)]

Answer: AD

QUESTION 32You 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?

A. Add a new Web page named Products.aspx to the Dynamic Data\PageTemplates folder of the Web site.B. Add a new folder named Products to the Dynamic Data\CustomPages folder of the Web site. Add a new Web page named ListDetails.aspx to the Products folder.C. Add a new Web user control named Products.ascx to the Dynamic Data\Filters folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.QueryableFilterUserControl.D. Add a new Web user control named Products_ListDetails.ascx to the Dynamic Data\EntityTemplates folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.EntityTemplateUserControl.

Answer: B

QUESTION 33You 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 class 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.)

A. Add a DynamicDataManager control to the Web page.B. Disable the auto-generated fields on GridView1. Add a DynamicField control for each field of the Product class.C. Add the following code segment to the Application_Start method in the Global.asax.cs file.DefaultModel.RegisterContext(typeof(System.Web.UI.WebControls.ObjectDataSource), new ContextConfiguration() {ScaffoldAllTables = true});D. Add the following code segment to the Page_Init method of the Web page.GridView1.EnableDynamicData(typeof(Product));

Answer: BD

QUESTION 34You 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}”);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?

A. At line 04 in the Global.asax.cs file, add the following line of code.routes.MapRoute(“Default4Empty”, “/”, new {controller = “Home”, action = “About”});B. At line 04 in the Global.asax.cs file, add the following line of code.routes.MapRoute(“Default”, “”, new {controller = “Home”, action = “About”});C. Replace line 05 in the Global.asax.cs file with the following line of code.routes.MapRoute(“Default4Empty”, “{controller}/{action}/{id}”, new {controller = “Home”, action = “About”, id = “”});D. Replace line 05 in the Global.asax.cs file with the following line of code.routes.MapRoute(“Default”, “{controller}/{action}”, new {controller = “Home”, action = “About”});

Answer: C

QUESTION 35You 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}”);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 Index()public ActionResult Details(int id)public ActionResult DetailsByUsername(string username)You need to add a route to meet the following requirements.– The details for a user must to be displayed when a user name is entered as the path by invoking the DetailsByUsername action.– User names can contain alphanumeric characters and underscores, and can be between 3 and 20 characters long.What should you do?

QUESTION 36You 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?

A. Add the ValidateAntiForgeryToken attribute to the Details action method.B. Add the Bind attribute to the country parameter of the Details action method. Set the attribute’s Prefix property to Country.C. Create a class that implements the IRouteConstraint interface. Configure the default route to use this class.D. Create a class that implements the IRouteHandler interface. Configure the default route to use this class.

Answer: C

QUESTION 37You 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.)

QUESTION 38You 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.)

A. Add the following attribute to the first Edit action.[AcceptVerbs(HttpVerbs.Head)]B. Add the following attribute to the first Edit action.[HttpGet]C. Add the following attribute to the second Edit action.[HttpPost]D. Add the following attribute to the second Edit action.[HttpPut]

Answer: BC

QUESTION 39You are implementing an ASP. NET MVC 2 Web application. You add a controller named CompanyController. You need to modify the application to handle the URL path /company/info. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Add the following method to the CompanyController class.public ActionResult info(){return View();}B. Add the following method to the CompanyController class.public ActionResult Company_Info(){return View();}C. Right-click the Views folder, and select View from the Add submenu to create the view for the action.D. Right-click inside the action method in the CompanyController class, and select Add View to create a view for the action.

Answer: AD

QUESTION 40You 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 area. You need to add a link to Info.aspx that points to Details.aspx. Which code segment should you use?