多项选择题

You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code.
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?()

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]


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题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?()

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.

4.单项选择题

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.
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.Query.
D.Add a new Web user control named Products_ListDetails.ascx to the DynamicData\EntityTemplates folder of the Web.In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.Entity.

5.多项选择题

You are implementing an ASP.NET Web site. The site contains the following class. 
The Web site interacts with an external data service that requires Address instances to be given in the following XML format.

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

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")]

6.多项选择题

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

You need to ensure that the GetProducts method can be called by using AJAX.Which two actions should you perform?()

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.

7.单项选择题

You are implementing an ASP.NET application. You add the following code segment.
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?()

A.var secretPeople = (from p in allPeople from u in secretUsers  where p.UserId == u select p).Distinct(); return allPeople.Except(secretPeople);
B.return from p in allPeople from u in secretUsers where p.UserId != u select p;
C.return (from p in allPeople  from u in secretUsers where p.UserId != u select p).Distinct();
D.List people = new List( from p in allPeople from u in secretUsers where p.UserId != u select p); return people.Distinct();

8.单项选择题

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.
You need to implement the UpdatePerson method to update the database row that corresponds to the personToEdit object. Which code segment should you use?()

A._entities.People.Attach(personToEdit); _entities.ObjectStateManager.ChangeObjectState(personToEdit, EntityState.Modified); _entities.SaveChanges();
B._entities.ObjectStateManager.ChangeObjectState(personToEdit, EntityState.Added);_entities.SaveChanges();
C._entities.People.ApplyCurrentValues(personToEdit); _entities.SaveChanges();
D._entities.People.Attach(new Person() { Id = personToEdit.Id });_entities.ObjectStateManager.ChangeObjectState(personToEdit, EntityState.Modified);_entities.SaveChanges();

9.单项选择题

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.

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?()

A.JsonValue = json.Serialize(people.Select(p => p.Name));
B.var names = from person in people select person; JsonValue = "{" + json.Serialize(names) + "}";
C.JsonValue = json.Serialize(people.SelectMany( p =>Name.AsEnumerable()));
D.var names = from person in people select person; JsonValue = json.Serialize(names);

10.单项选择题

You are implementing an ASP.NET page. You add and configure the following 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? ()

A.Replace the asp:QueryStringParameter with the following declaration.
B.Replace the asp:QueryStringParameter with the following declaration.
C.Add the following event handler to the Selecting event of the ObjectDataSource control.
D.Add the following code segment to the page’s code-behind.

最新试题

You are developing a WCF service. The service includes an operation names GetProduct. You need to ensure that GetProduct will accept a POST request and will indicate that the returned data is XML.  Which two actions should you perform?()

题型:多项选择题

You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform.  You are creating an ASP.NET Web application using .NET Framework 4.0. The Web application comprises a class named Employee with properties named as First Name, Last Name, and Age. You add a Web page in which you get a list of Employee objects and display those objects in a GridView control. You are required to add code so that the GridView row is highlighted in red color if the age of the employee is less than 21 years.  What will you do to accomplish this?()

题型:单项选择题

Which utility allows you to pre-compile and publish your Web site to a new location?()

题型:单项选择题

In a web page with chechboxes you need to write e jquery that retruns the number checked checkboxes.()

题型:单项选择题

You have to store user data of 200 KB in an object. Which state management technique to use:()

题型:单项选择题

You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform. You create an ASP.NET Web application using .NET Framework 4.0. The Web application connects to a SQL Server database. You use the ADO.NET Entity Framework to handle persistence-ignorant entities. You create an ObjectContext object named ObjContext. Subsequently, you change properties on numerous entities. You are required to save the changed entity values in the SQL Server database. Which of the following code segments will you use?()

题型:单项选择题

The page will be posted to the server after one or more image files are selected for upload.You need to ensure that all unuploaded files are saved to the server within one call to a single event handler. What should you do? ()

题型:单项选择题

Which class defines the contract that ASP.NET implements to provide membership services using custom membership providers?()

题型:单项选择题

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

题型:单项选择题

You develop an ASP.NET Web page that includes multiple WebPartZone controls, an EditorZone. Users report that they cannot customize the layout of the page by moving WebParts from one.You need to ensure that users can successfully move Web Parts from one zone to another. What should you do?()

题型:单项选择题