class jamiu{
public string id{get; set;}
public string Name {get; set;}
}
public static List<jamiu> getdata(){
List<jamiu> jam=new List<jamiu>();
SqlConnection con=new SqlConnection();
SqlCommand cmd=new SqlCommand();
cmd.connection=con;
cmd.CommandText="select *from Table";
SqlDataReader dr=cmmd.ExecuteReader();
DataTable dt=new DataTable();
for (Int32 i = 0; i < dt.Rows.Count; i++)
{dt.Load(dr);
jamiu jj=new jamiu();
jj.id=dt.Rows[1]["Id"].ToString();
}
dr.Close();
con.Close();
}
<script>
$(document).ready(function () {
var schli=document.getElementById(schlidd).innerText;
$.ajax({
type:"Post",
dataType: "json",
url: "Default.aspx/getbook",
data: "{'Id':'" + schli + "'}",
success: function (data) {
if (data.d.length > 0) {
$("#dd").html('');
for (var i = 0; i < data.d.length; i++) {
var List = ["<tr><td>" + data.d[i].Id + "</td><td>"];
$("#dd").append(List);
}
}
}
})
})
</script>