You are developing an ASP.NET MVC application.
The application must allow users to enter HTML in a feedback text box only.
You need to disable request validation.
What should you do?
A.
Use the HttpRequest.Form property to read the unvalidated form value.
B.
Apply and set the Validatelnput attribute on the controller action to FALSE.
C.
Use the HttpRequest.Unvalidated property to read the unvalidated form value.
D.
Apply and set the CausesValidation attribute on the controller action to FALSE.
Explanation:
The HttpRequest.Unvalidated Property provides access to HTTP request values without triggering
request validation.
Correct is B.
Sorry, C is ok: https://msdn.microsoft.com/en-us/library/hh882339%28v=vs.110%29.aspx
var rawComment = Request.Unvalidated().Form[“comment”]; from https://msdn.microsoft.com/en-us/library/hh882339%28v=vs.110%29.aspx
So Unvalidated is not property. It is a method of Request controller property (HttpRequest is type of this property)
You are so wrong ! In .NET 4.5 Frameworks the Unvalidated property is available. That property allow you to access to form parameter without triggering request validation. https://msdn.microsoft.com/en-us/library/system.web.httprequest.unvalidated(v=vs.110).aspx
The B you are referring to would have been correct had it been the Attribute was set on the Action method in the Controller rather than the Textbook as mentioned in the option. There is no property named ValidateInput at the textbox.
Answer C is right
Duplicated with Q.62 http://www.aiotestking.com/microsoft/you-need-to-disable-request-validation-2/
http://stackoverflow.com/questions/3621272/allow-user-to-input-html-in-asp-net-mvc-validateinput-or-allowhtml