Sitecore 10 .NET Developer Certification — Question 26
With Sitecore MVC, how do you ensure a field cannot be edited when you use the field helper to render content?
Answer options
- A. Use the non-editable equivalent field type.
- B. Use the DisableWebEdit option.
- C. Set the editable parameter to "false".
- D. Mark the field as non-editable in the field definition item.
Correct answer: B
Explanation
The correct answer is B, as using the DisableWebEdit option explicitly prevents editing for that field when rendered. Options A and D are incorrect because they suggest alternatives that do not directly prevent editing in the rendering context. Option C is also not correct since setting the editable parameter to 'false' does not apply within the context of the field helper rendering.