You can create new
readonly property in
Model for
MonthlySalary as shown below and can access this property in
View through
Model. This
readonly property calculates
Monthly Salary automatically depending upon the value of
AnnualSalary property.
Public decimal MonthlySalary
{
get {
return AnnualSalary/12;
}
}
I hope this will help you :)