从AJAX无法将数据追加到表

时间:2018-09-23 10:23:47

标签: jquery asp.net ajax

我有下面的表格

MySubviews

我有一个Ajax可以将数据附加到tbody

func toggleHeight(with subview: MySubview) {
   subview.toggleHeight()
   UIView.animate(withDuration: 0.8) {
      self.view.layoutIfNeeded()
   }
}

这很好。

然后出于某些需要,我在表标签中添加了<table class="table" id="tbl"> <thead> <tr> <th">ID</th> /* some headings */ </tr> </thead> <tbody class="tbodyAppend"> /* need to append data here */ </tbody> </table> 。我需要此属性才能在服务器端获取表,但是添加后,此追加无法正常工作。我在ajax成功中获得了数据,但是追加无法正常工作。

这是怎么了?请帮忙。

1 个答案:

答案 0 :(得分:1)

runat =“ server”将表控件的ID更改为“ ContentPlaceHolderName_tbl”。 如果您要在searchAppend函数中访问带有“ tbl” ID的表,它将无法找到它。