Microsoft
70-515 · Question #88
You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your…
The correct answer is A. <%: Model.FirstName %>. See the full explanation below for the reasoning.
Question
You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your code avoids cross-site scripting. Which code segment should you use?
Options
- A<%: Model.FirstName %>
- B<%= Model.FirstName %>
- C<% Response.Write(Model.FirstName) %>
- D<% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)) %>
How the community answered
(54 responses)- A72% (39)
- B15% (8)
- C9% (5)
- D4% (2)
Community Discussion
No community discussion yet for this question.