exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 47 discussion

Actual exam question from Microsoft's 70-486
Question #: 47
Topic #: 1
[All 70-486 Questions]

You are developing a controller for an ASP.NET MVC application that manages message board postings.
The security protection built in to ASP.NET is preventing users from saving their HTML.
You need to enable users to edit and save their HTML while maintaining existing security protection measures.
Which code segment should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Example: ValidateInput at Action Method Level
The user can submit Html for this action method successfully with the following code. public class HomeController : Controller
{
public ActionResult AddArticle()
{
return View();
}
[ValidateInput(false)]
[HttpPost]
public ActionResult AddArticle(BlogModel blog)
{
if (ModelState.IsValid)
{
. . .
}
return View();
}
}
References:
http://www.dotnettricks.com/learn/mvc/html-submission-by-validateinput-and-allowhtml-attribute-in-mvc4

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hungry_ape9000
Highly Voted 5 years, 2 months ago
FINAL ANSWER: D is correct
upvoted 6 times
...
founderDev
Highly Voted 5 years, 5 months ago
this answer is correct. See for more information :https://www.aspsnippets.com/Articles/ValidateInputfalse-vs-AllowHtml-Difference-between-ValidateInputfalse-and-AllowHtml-in-ASPNet-MVC.aspx
upvoted 5 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...