O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the Calculator Tab

The last area of functionality we have to build is the Calculator tab. I have started by creating a couple of view model classes in the Models/View folder. The classes are called CalcData and CalcResult and are shown in Listing 31-39.

Listing 31-39. View model classes to support the Calculator tab

using System.ComponentModel.DataAnnotations; namespace TriathlonApp.Models.View {     public class CalcData {         public CalcData() {             Laps = 80;             PoolLength = 20;             Minutes = 60;             CalsPerHour = 1070;         }         [Required]         [Range(1, 500)]         public int Laps { get; set; }         [Required]         [Range(10, 500)]         public int PoolLength { get; set; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required