I want to list the result of calculation in a list or in a grid view.
Following is my code:
protected void btnDepreciate_Click(object sender, EventArgs e)
{
int ScrapValue = int.Parse(lblScrapValue.Text);
int bookValue = int.Parse(lblAssetCost.Text);
int assetlife = int.Parse(lblAssetLife.Text);
int depreciation = 0;
int i;
for (i = 1; i <= assetlife; i++)
{
depreciation = (bookValue - ScrapValue) / assetlife;
Response.Write("Year" + i + "=" + depreciation);
}
bookValue = bookValue - depreciation;
}
This code writes the result but I want it on a grid or a list with the Year.