70-515 · Question #29
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. public…
The correct answer is B. Apply the ScriptService attribute to the ProductService class. C. Apply the WebMethod attribute to the GetProducts method. See the full explanation below for the reasoning.
Question
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. 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.)
Options
- AApply the WebService attribute to the ProductService class.
- BApply the ScriptService attribute to the ProductService class.
- CApply the WebMethod attribute to the GetProducts method.
- DApply the ScriptMethod attribute to the GetProducts method.
How the community answered
(57 responses)- A14% (8)
- B79% (45)
- D7% (4)
Community Discussion
No community discussion yet for this question.