Hi Waghuldey,
I have modified your code. Refer the below code.
HTML
MasterPage.master
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Default2.aspx
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css" />
<script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('[id*=tblCustomers]').DataTable();
});
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<div class="col-md-offset-2 col-lg-offset-2 col-md-8 col-lg-8 col-md-offset-2 col-lg-offset-2">
<div class="panel panel-info">
<div class="panel-heading">
<div class="title">
DataTable
</div>
</div>
<div class="panel-body">
<asp:Repeater ID="rptCustomers" runat="server">
<HeaderTemplate>
<table id="tblCustomers" class="table table-striped table-bordered" border="0" cellpadding="0"
cellspacing="0">
<thead>
<tr>
<th>
Employee Number
</th>
<th>
Name
</th>
<th>
Designation
</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%#DataBinder.Eval(Container.DataItem,"EmpNumber") %>
</td>
<td>
<%#DataBinder.Eval(Container.DataItem,"Name") %>
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "Designation")%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody></table>
</FooterTemplate>
</asp:Repeater>
</div>
</div>
</div>
</div>
</asp:Content>
Code
Default2.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] {
new DataColumn("EmpNumber", typeof(int)),
new DataColumn("Name", typeof(string)),
new DataColumn("Designation",typeof(string)) });
dt.Rows.Add(1, "John Hammond", "Developer");
dt.Rows.Add(2, "Mudassar Khan", "CEO");
dt.Rows.Add(3, "Suzanne Mathews", "Tester");
dt.Rows.Add(4, "Robert Schidner", "Manager");
rptCustomers.DataSource = dt;
rptCustomers.DataBind();
}
}
Screenshot