Clicking edit button in gridview on paging takes to first page instead of getting stayed in the curr
Below is my Jquery Datatable code that i used for searching the data in gridview.Everything works fine but suppose if my gridview has 13 pages with 10 records per each page ,when i click edit in my gridview let us assume 5th page it is taking me to first page on clicking edit button from any of the page it is taking me to first page instead of staying on the current page.How can i stay in the same page on clicking edit button.<script type="text/javascript" src="DataTable/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="DataTable/jquery.dataTables.min.js"></script>
<script>
$(function () {
// Setup - add a text input to each footer cell
$('#<%=GridView1.ClientID %> th').each(function () {
var title = $(this).text();
if (title == "A Name" || title == " Name" || title == "ttl") {
$(this).html(title + '<br/><input type="text" style="width:120px" placeholder="Search ' + title + '" />');
}
else {
if (title != " ") {
//$(this).html(title + '<br/><input type="text" style="background-color:#646464;border:none" disabled="disabled" />');
}
}
});
// DataTable
var table = $('#<%=GridView1.ClientID %>').DataTable({
"paging": true,
"ordering": false,
"info": false,
"pageLength": 10,
"bLengthChange": false
});
table.columns().every( function () {
var that = this;
$( 'input', this.header() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
</script>