Which code segment should you use?

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

microsoft-exams

3 thoughts on “Which code segment should you use?

  1. Answer is 100% D, not B. With B answer, we obtain the opposite preventing the user from saving his HTML

  2. If the “[ValidateInput(false)]” was on the controller then html will be allowed to all methods in the controller which may not be desirable.

    The value of having “[ValidateInput(false)]” to dress the controller method is not only to allow html in the method but also to maintain existing security measures.

    correct answer: D

Leave a Reply

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


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