Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 从ajax向表中追加数据不起作用_Jquery_Asp.net_Ajax - Fatal编程技术网

Jquery 从ajax向表中追加数据不起作用

Jquery 从ajax向表中追加数据不起作用,jquery,asp.net,ajax,Jquery,Asp.net,Ajax,我有下面这样的桌子 <table class="table" id="tbl"> <thead> <tr> <th">ID</th> /* some headings */ </tr> </thead> <tbody class="tbodyAppend"> /* need to a

我有下面这样的桌子

<table class="table" id="tbl">
    <thead>
        <tr>
            <th">ID</th>
            /* some headings */
        </tr>
    </thead>
    <tbody class="tbodyAppend">
        /* need to append data here */
    </tbody>
</table>
这很好用

然后,出于某些需要,我在table标记中添加了
runat=“server”
。我需要这个属性来获取服务器端的表,但是在我添加这个属性之后,这个附加就不起作用了。我在ajax中成功地获得了数据,但append不起作用

这里怎么了?请提供帮助。

runat=“server”将表控件的id更改为“contentplaceholder name\u tbl”。
若您在searchAppend函数中访问id为“tbl”的表,它将找不到它

那么如何附加ajax结果呢?
$.ajax({
    type: "POST",
    url: "AdminView.aspx/searchNECB",
    contentType: "application/json; charset=utf-8",
    data: '',
    dataType: "json",
    success: function (data) {
        console.log(data)  // data coming here in both times
        searchAppend(data.d);
    },
    error: function (msg) {
        alert("error");
    }
});