You are developing an ASP.NET MVC application. The application must allow users to enter JavaScript in a feedback text box only. You need to disable request validation. What should you do?
A.
Apply and set the CausesClientSideValidation attribute on the text box to FALSE.
B.
Apply and set the ValidateInput attributeon the text box to FALSE.
C.
Use the HttpRequest.Unvalidated property to read the unvalidated form value.
D.
Use the HttpRequest.Form property to read the unvalidated form value.
Suggested Answer:C🗳️
The HttpRequest.Unvalidated property gets the HTTPrequest values without triggering request validation. Request validation checks for HTML markup and script that might indicate a potential cross-site scripting attack. By default, all values are checked using request validation and if any values contain markup or script, ASP.NET throws an HttpRequestValidationException exception. Use this method if you anticipate that the request will contain markup (for example, you are allowing users to post content that contains markup) and you want to get the raw value of a request. References: https://msdn.microsoft.com/en-us/library/system.web.httprequest.unvalidated.aspx
I think both B and C are valid in practice, since in both cases request validation is disabled, but C is semantically more correct by a subtle difference: with ValidateInputAttribute=false you are disabling Action validation, not Request validation.
The correct answer is C because 'You need to disable request validation in
a feedback text box only'.
https://docs.microsoft.com/en-us/previous-versions/aspnet/hh882339(v=vs.110)?redirectedfrom=MSDN
Answer is C
Request validation checks for HTML markup and script . By default, all values are checked using request validation and if any values contain markup or script, ASP.NET throws an HttpRequestValidationException exception. Use this method if you anticipate that the request will contain markup (for example, you are allowing users to post content that contains markup) and you want to get the raw value of a request.
The correct answer is C: Keypoint is Feedback sent to the server with the request, so the application wants raw data from the user. HttpRequest.Unvalidated enables us to selectively validate the request.
I think that the key words here are "disable validation". So you have to disable validation for the textbox and not only read the unvalidated value. I'll go for B
I think the answer is B
Why isn't this [ValidateInput(false)]
https://dotnettutorials.net/lesson/validateinput-attribute-mvc/
https://docs.microsoft.com/en-us/dotnet/api/system.web.mvc.validateinputattribute?view=aspnet-mvc-5.2
This section is not available anymore. Please use the main Exam Page.70-486 Exam Questions
Log in to ExamTopics
Sign in:
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.
rortegax2
4 years, 4 months agoticemm
4 years, 6 months agomarkcowell
4 years, 7 months agoParkPalaceJoe
4 years, 7 months agokar12
4 years, 7 months agoAkidoki87
4 years, 8 months agoAkidoki87
4 years, 8 months agotheEdgeFL
4 years, 11 months agoapostolin
5 years, 7 months ago