Microsoft
70-515 · Question #45
70-515 Question #45: Real Exam Question with Answer & Explanation
Sign in or unlock 70-515 to reveal the answer and full explanation for question #45. The question stem and answer options stay visible for context.
Question
You are implementing an ASP.NET MVC 2 Web application that contains the following class. public class DepartmentController : Controller { static List<Department> departments = new List<Department>(); public ActionResult Index() { return View(departments); } public ActionResult Details(int id) { return View(departments.Find(x => x.ID==id)); } public ActionResult ListEmployees(Department d) { List<Employee> employees = GetEmployees(d); return View(employees); } } You create a strongly typed view that displays details for a Department instance. You want the view to also include a listing of department employees. You need to write a code segment that will call the ListEmployees action method and output the results in place. Which code segment should you use?
Options
- A<%= Html.Action("ListEmployees", Model) %>
- B<%= Html.ActionLink("ListEmployees", "Department",
- C<% Html.RenderPartial("ListEmployees", Model); %>
- D<%= Html.DisplayForModel("ListEmployees") %>
Unlock 70-515 to see the answer
You've previewed enough free 70-515 questions. Unlock 70-515 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.