i have following code how to bind grid using Java script i want to call aspx.cs code and retrieve data and bind with grid without post-back please help me. i am new asp.net please help me. i have call this method but not success
<script type='text/javascript'>
$(document).ready(function () {
bindjs();
})
function bindjs() {
PageMethods.BindGrid(Success, Failure);
}
function Success(result) {
alert(result);
}
function Failure(error) {
alert(error);
}
</script>
and my Asp.cs method is
[WebMethod]
public static DataTable BindGrid()
{
con = new SqlConnection(constr);
da = new SqlDataAdapter("select tblStudent.student_id,tblStudent.student_name,tblStudent.father_name," +
"tblStudent.Cell,tblStudent.parents_cell,tblStudent.admission_date,tblclassinfo.class_name,address_student" +
" from tblStudent inner join tblclassinfo on tblStudent.class_id = tblclassinfo.class_id", con);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}