Answers

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, ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.