多项选择题You 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?()

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.
D.Add the following code segment to the Page_Init method of the Web page.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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.

2.多项选择题

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

3.多项选择题

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.

4.单项选择题

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

5.单项选择题

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

6.单项选择题

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

7.单项选择题

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.

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

A. dtlView.DataSource = GetCustomerOrderDataSet(); dtlView.DataMember = "OrderDetailsTable"; dtlView.DataBind();
B.dtlView.DataSource = GetCustomerOrderDataSet(); dtlView.DataSourceID = "OrderDetailsTable"; dtlView.DataBind();
C.dtlView.DataSource = GetCustomerOrderDataSet(); dtlView.DataKeyNames = new string [] { "OrderDetailsTable"}; dtlView.DataBind();
D.DataSet dataSet = GetCustomerOrderDataSet(); dtlView.DataSource = new DataTable("dataSet", "OrderDetailsTable"); dtlView.DataBind();

9.单项选择题You 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  section of the web.config file.
D.Add the following rule to the  section of the web.config file.

最新试题

You have migrated a web application from .net 3.5 to 4.0. the application hat to render same as in .net 3.5.()

题型:单项选择题

Which tool is used to simplify the migration, management and deployment of IIS Web servers, Web applications and Web sites?()

题型:单项选择题

Which class is used to specify a set of features to support on the XrnlReader object created by the Create method?()

题型:单项选择题

You are developing an ASP.NET Web application.The application is configured to use the membership and role providers. You need to allow all users to perform an HTTP GET for application resources, but you must allow only the user named Moderator to perform a POST operation.Which configuration should you add to the web.config file?()

题型:单项选择题

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

题型:单项选择题

You are implementing an ASP.NET Web page. The page includes several controls, but only a GridView requires view state. You set the GridView… You need to ensure that the page will omit unneeded view state. Wich @ Page directive should you use?()

题型:单项选择题

You are developing a Asp.net web application tht includes a panel control that has ID contentsection.You need to add a textBox control to the panel control.()

题型:单项选择题

You are debugging an ASP.NET Web application by using the Visual Studio debugger. The application is incorrectly handling a SQL Exception on the login page. You need to break execution where the exception is thrown . What should you do?()

题型:单项选择题

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. You create a Web page in the application. The Web page will get large sets of data from a data source.  You add a DataPager control to the page. You are required to display navigation controls that enable you to create a custom paging Ul for the DataPager control. What will you do?()

题型:单项选择题

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

题型:多项选择题