How do i call variables from a .cs class file to .aspx.cs file and the other way round. I have the code below. I have already placed placed namespaces int the code. For example i want to call CantTakeLoan variable in .aspx.cs file.
.cs class file
public class LoanCalculator
{
public decimal Amnt;
public double MonthlyInstallment;
private string ex;
public decimal Calculator(double Amount, double Months)
{
try
{
var Rate = 0.75;
MonthlyInstallment = Amount / ((Math.Pow(1 + Rate, Months) - 1) / (Rate * Math.Pow(1 + Rate, Months)));
double LoanLimit = 0.25 * Salary;
if( (MonthlyInstallment < LoanLimit)
{
CantTakeLoan = "Please Not That You Cant Take Loan";
}
else
{
}
}
catch (Exception ex)
{
}
return Amnt;
}
}
.aspx.cs file
protected void Unnamed_Click(object sender, EventArgs e)
{
try
{
//call variables from .cs file
}
catch(Exception ex)
{
}
}
}
LoanCalculator a =new LoanCalculator();then how will i call the variable. Forgive me i am new to C# development.