Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Listing value

$
0
0

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.


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>