Câu 71: 70-486: MCSD Developing ASP.NET MVC 4 Web Applications
You are developing an ASP. NET MVC application. The application has a contact view includes a form for editing the displayed contact. You need to save the Contact object model when the form is posted back to the EditContact method using a POST method request. Which code segment should you use? Each correct answer pres…
Nội dung câu hỏi
You are developing an ASP. NET MVC application. The application has a contact view includes a form for editing the displayed contact. You need to save the Contact object model when the form is posted back to the EditContact method using a POST method request. Which code segment should you use? Each correct answer presents a complete solution. Choose all that apply.
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. public ActionResult EditContact(){var c = newContact(){FirstName = Request.QueryString['"FirstName"'],LastName = Request.QueryString ["LastName"]},SaveContact(c);return View(c);} — đáp án hiện tại
- B. public ActionResult EditContact(Contact c){SaveContact(c);return View(c);} — đáp án hiện tại
- C. public ActionResult EditContact(FormCollection values){var c = newContact(){FirstName = values['"FirstName"'],LastName = values ["LastName"]},SaveContact(c);return View(c);}
- D. public ActionResult EditContact(QueryStringProvider values){var c = newContact(){FirstName = values.GetValue['"FirstName"'],LastName = values.GetValue
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.