Which code segment should you use?

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.
A. public ActionResult EditContact(){var c = newContact(){FirstName = Request.QueryString[‘"FirstName"’],LastName = Request.QueryString ["LastName"]},SaveContact(c);return View(c);}
B. public ActionResult EditContact(Contact c){SaveContact(c);return View(c);}
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
["LastName"]},SaveContact(c);return View(c);}

microsoft-exams

2 thoughts on “Which code segment should you use?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.