Master page is not a hurdle it just a damm container. Look code below it is working fine.
css
.highlight
{
background-color:Yellow;
}
html
<asp:gridview id="gvinner" runat="server" autogeneratecolumns="false" allowpaging="false" xmlns:asp="#unknown">
AllowSorting="false" Width="400px" UseAccessibleHeader="true" CellPadding="0"
CellSpacing="0">
<columns>
<asp:templatefield headertext="cname">
<itemtemplate>
<%# Eval("cname")%>
</itemtemplate>
</asp:templatefield>
<asp:templatefield headertext="details">
<itemtemplate>
<%# Eval("details")%>
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
js in same page's header
<script src="jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="jquery.dataTables.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#gvinner').dataTable({
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
var settings = this.fnSettings();
var str = settings.oPreviousSearch.sSearch;
$('td', nRow).each(function(i) {
this.innerHTML = aData[i].replace(new RegExp(str, 'i'), function(matched) { return "<span class='highlight'>" + matched + "</span>"; });
});
return nRow;
}
});
});
</script>
.cs
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = Gedata();
gvinner.DataSource = ds;
gvinner.DataBind();
gvinner.HeaderRow.TableSection = TableRowSection.TableHeader;
}