Integrated development environments (IDEs) provide tools for debugging code by setting breakpoints in the code to inspect the state of the application during processing. In web app development, we can inspect our app using the developer tools available in our web broswers.

Chrome developer tools
Chrome

View ⇨ Developer ⇨ Developer Tools

Firefox developer tools
Firefox

Tools ⇨ Browser Tools ⇨ Web Developer Tools

Safari developer tools
Safari

Develop ⇨ Show Web Inspector

Edge developer tools
Edge

Right click ⇨ Inspect

Form Data Validation

Validate that data entered into a web form matches expectations. Validation provides assurances around:

Validation can occur on the front-end using Javascript, the back-end on the web server, or both.

web form

In ASP.net MVC Core we can use Data Annotations: Implemented by

  1. Adding namespace
    using System.ComponentModel.DataAnnotations;
  2. Annotating class property declarations with one or more constraints. Some examples include:
    [Required(ErrorMessage = "")]
    [Range(n, m, ErrorMessage = "")]
    [StringLength(n, ErrorMessage = "")]
  3. An example using 2 constraints from the MVC Tutorial
    [Required(ErrorMessage = "An Album Title is required")]
    [StringLength(160)]
    public string Title { get; set; }