This section contains the solutions to the thought experiments and answers to the lesson review questions in this chapter.

Objective 3.1: Thought experiment

  1. It looks like malicious users are entering HTML in the text fields. This data gets submitted to the server and rendered the next time the page is viewed.

  2. You need to use regular expressions to restrict the user input. By making clear which characters you allow, you can strip the input of the HTML characters and make sure they are not showing up in the page layout.

Objective 3.1: Review

  1. Correct answer: B

    1. Incorrect: Parse will throw an exception when the user enters an invalid date,, which is not uncommon.

    2. Correct: TryParse will see whether the entered value is a valid date. If not, it will ...

Get Exam Ref 70-483: Programming in C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.