使用ASP.NET中的jquery ajax调用方法将数据库值显示到HTML表中 [英] Display database value into HTML table using jquery ajax call method in ASP.NET
问题描述
亲爱的,
i尝试使用asp.net中的jquery ajax调用方法将数据库值显示到html表中
但它没有显示。请帮助我
我尝试了什么:
功能Bindtable( ){
$(文件).ready(function(){
var row =;
$ .ajax({
类型:POST,
url:wsc_common.asmx / bindtable,
data:{ },
contentType:application / json; charset = utf-8,
dataType:json,
成功:功能(msg){
$ .each(msg.d,function(index,obj){
row + =
+ obj.pid + | + obj.p_name + | + obj.p_mobile + | + obj.p_location + |
});
$(#tbDetails tbody)。append(row);
}
});
});
}
dear all,
i am trying to display database value into html table using jquery ajax call method in asp.net
but its not displaying. plese help me
What I have tried:
function Bindtable() {
$(document).ready(function () {
var row = "";
$.ajax({
type: "POST",
url: "wsc_common.asmx/bindtable",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
$.each(msg.d, function (index, obj) {
row += "
" + obj.pid + " | " + obj.p_name + " | " + obj.p_mobile + " | " + obj.p_location + " |
});
$("#tbDetails tbody").append(row);
}
});
});
}
推荐答案
(文件).ready(function(){
var row =;
(document).ready(function () {
var row = "";
.ajax({
type:POST,
url:wsc_common.asmx / bindtable,
data:{},
contentType:application / json; charset = utf-8,
dataType:json,
成功:函数(msg){
.ajax({
type: "POST",
url: "wsc_common.asmx/bindtable",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
.each(msg.d,function(index,obj){
row + =;
+ obj.pid + + obj.p_name + + obj.p_mobile + + obj.p_location +
});
.each(msg.d, function (index, obj) {
row += "";
" + obj.pid + " " + obj.p_name + " " + obj.p_mobile + " " + obj.p_location + "
});
这篇关于使用ASP.NET中的jquery ajax调用方法将数据库值显示到HTML表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!