日期:2014-05-16 浏览次数:20663 次
<script>
$(function () {
$("#btJs").click(function () {
$id=$("#txname").val();
$.ajax({
type: "post",
url: "tbToJson.ashx",
data: {id:$id}
dataType: "json", //返回数据格式
success:function(data){
var tb = "<table id='tdd' ><tr><td>ID</td><td>title</td></tr>";
for (var i = 0; i < data.length; i++) {
tb += "<tr><td>" + data[i].TypeName + "</td><td>" + data[i]["Remark"] + "</td></tr>";
}
tb += "</table>";
$("#div1").append(tb);
}
});
});
})
</script>
context.Response.ContentType = "text/plain";
string id = context.Request.Form["id"].ToString();
string String = ConfigurationManager.ConnectionStrings["MovieConnection"].ToString();
SqlConnection con = new SqlConnection(String);
con.Open();
SqlDataAdapter da = new SqlDataAdapter("