7
Answers

pagination of html table using mvc

@model Member.Models.MemberInfo
@{
    ViewBag.Title = "MemberDetails";
}

<style type="text/css">
    body {
        font-family: Arial;
        font-size: 10pt;
    }

    table {
        border: 1px solid #ccc;
        border-collapse: collapse;
        background-color: #fff;
    }

        table th {
            background-color: #B8DBFD;
            color: #333;
            font-weight: bold;
        }

        table th, table td {
            padding: 5px;
            border: 1px solid #ccc;
        }

        table, table table td {
            border: 0px solid #ccc;
        }
</style>



<h2>MemberDetails</h2>



@using (Html.BeginForm("MemberDetails", "Member", FormMethod.Post))
{
         
    <table>
        <tr>
            <td>
                @Html.ActionLink("Search By Phone Number ", "InsertMobile")
            </td>
        </tr>
    </table>


    <table style="width: 100%">
        <tr>
            <th>Screen Name</th>
            <th>Mobile Number</th>
            <th>SmsBalance</th>
        </tr>


        @{

    for (int i = 0; i < Model.StoreAllData.Tables[0].Rows.Count; i++)
    {
        var MemberId = Model.StoreAllData.Tables[0].Rows[i]["MemberId"].ToString();
        var ScreenName = Model.StoreAllData.Tables[0].Rows[i]["ScreenName"].ToString();
        var MobileNo = Model.StoreAllData.Tables[0].Rows[i]["MobileNo"].ToString();
        var SmsBalance = Model.StoreAllData.Tables[0].Rows[i]["SmsBalance"].ToString();
      
            <tr>

                <td>
                    @ScreenName
                </td>

                <td>
                    @MobileNo
                </td>
                <td>
                    @SmsBalance
                </td>
            </tr>
    }
        }
       
    </table>
    
   
}

 
 
how to add paging .i don't want to use entity framework
Answers (7)