Tuesday, 7 May 2019

Show Serial number for Table column

Some time we retrieve data from the database and render in the table and we want to show serial number, then this article will help you to show the serial number using foreach loop  using razor.

<table class="table table-bordered table-hover">

            <th align="center">Sr No.</th>
            <th align="center">Leave Type</th>
            <th align="center">Quantity</th>
        @{int i = 1;}

        @foreach (var item in Model.ConsumeLeave)

No comments:

Post a comment