多项选择题

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.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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

2.单项选择题

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

3.单项选择题

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

4.单项选择题

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.

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

6.单项选择题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.

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

A.void Application_Start(object sender, EventArgs e) { SiteHelper.Configure(); }
B.void Application_Init(object sender, EventArgs e) { SiteHelper.Configure(); }
C.void Application_BeginRequest(object sender, EventArgs e) { SiteHelper.Configure(); }
D.Object lockObject = new Object(); void Application_BeginRequest(object sender, EventArgs e) { lock(lockObject()) { SiteHelper.Configure(); } }

9.单项选择题You are implementing an ASP.NET Web site. The root directory of the site contains a page named Error.aspx. You need to display the Error.aspx page if an unhandled error occurs on any page within the site. You also must ensure that the original URL in the browser is not changed. What should you do?()

A.Add the following configuration to the web.config file.
B.Add the following configuration to the web.config file.
C.Add the following code segment to the Global.asax file.
D.Add the following code segment to the Global.asax file.

10.单项选择题You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role namedAdministrators. Which code segment should you use?()

A.bool isMember = Roles.GetUsersInRole("Administrators").Any()
B.bool isMember = Membership.ValidateUser(User.Identity.Name, "Administrators")
C.bool isMember = Roles.GetRolesForUser("Administrators").Any()
D.bool isMember = User.IsInRole("Administrators")

最新试题

You create an ASP.NET server control in the SampleControl namespace. The control uses a JavaScript file names Refresh.js to implement AJAX functionality.You need to ensre that the JavaScript file is included in the assembly. Which two actions should you perform?()

题型:多项选择题

You are developing an ASP.NET Web page that uses jQuery validation. The user should enter a valid email address in a text box that has ID txtEmail. The page must display "E-Mail address required" when the user does not enter an address and "Invalid e-mailaddress" when the user enters an address that is not formatted properly. You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address.  Which two code segments should you add?()

题型:多项选择题

You have to store user data of 200 KB in an object. Which state management technique to 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? ()

题型:单项选择题

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

题型:单项选择题

Which control allows you to bind to data items that are returned from a data source and display them?()

题型:单项选择题

Which of the following is the correct collection of build events?()

题型:单项选择题

You are developing an ASP.NET Web application. The application must pass an object that contains user-specific data between multiple pages. The object ismore than 100 KB in size when serialized.You need to minimize the amount of data is sent to the user.What should you do?()

题型:单项选择题

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

题型:单项选择题

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

题型:单项选择题