相关疑难解决方法(0)

将jQuery数据绑定到gridview时出现异常

我试图将jquery数据绑定到gridview.它抛出异常.

"该表必须按标题,正文和页脚的顺序包含行部分."

脚步

1)JavaScript调用

<script type="text/javascript" charset="utf-8">
/* Define two custom functions (asc and desc) for string sorting */
  $(document).ready(function () {
    /* Build the DataTable with third column using our custom sort functions */
    $('#gvInitiavtives').dataTable({
        "aaSorting": [[0, 'asc']          
    });
});
Run Code Online (Sandbox Code Playgroud)

2)Gridview

 <asp:GridView ID="gvInitiavtives" runat="server" Width="100%" CssClass="Grid" 
                     RowStyle-Width="30px" AutoGenerateColumns="false" HeaderStyle-CssClass="GridHeader"  RowStyle-CssClass="GridItem" AlternatingRowStyle-CssClass="GridAltItem"  DataKeyNames="InitiativeIdx" AllowSorting="true" ClientIDMode="Static" >
                <EmptyDataRowStyle BorderStyle="None" BorderWidth="0px" />
                <EmptyDataTemplate>
                    <asp:Label ID="lblNorecId" runat="server" Text="Sorry! Your requested records are not found, please try with other search criteria." Font-Bold="true" ForeColor="red" Font-Names="Arial" …
Run Code Online (Sandbox Code Playgroud)

c# asp.net jquery gridview datatables

6
推荐指数
1
解决办法
1671
查看次数

标签 统计

asp.net ×1

c# ×1

datatables ×1

gridview ×1

jquery ×1