我正在尝试从 sql 源创建数据表,并且我希望能够使用 jquery 数据表过滤器过滤结果。有没有办法用我所拥有的来做到这一点?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Glossary.aspx.cs" Inherits="Home.Glossary" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title spellcheck="true">Lexis Nexis Glossary</title>
</head>
<body>
<form id="form1" runat="server">
<div style="margin-left: 720px">
</div>
<asp:SqlDataSource ID="TedGlossary" runat="server" ConnectionString="<%$ ConnectionStrings:Glsry_Taylor %>" SelectCommand="SELECT [TermText], [DefNbr], [DefVerNbr], [DefText], [AmplifyingExplanationText], [SeeAlsoText], [AuthoritativeSrcText], [ScopeName], [DomnName], [GovernanceStateName], [LastUpdtTimestamp] FROM [Glossary] ORDER BY [TermText]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="TermText,DefNbr,DefVerNbr" DataSourceID="TedGlossary" EnableSortingAndPagingCallbacks="True">
<Columns>
<asp:BoundField DataField="TermText" HeaderText="Term" ReadOnly="True" SortExpression="TermText" />
<asp:BoundField DataField="DefNbr" HeaderText="Definition #" ReadOnly="True" SortExpression="DefNbr" />
<asp:BoundField DataField="DefVerNbr" HeaderText="Definition Vers #" ReadOnly="True" SortExpression="DefVerNbr" />
<asp:BoundField DataField="DefText" HeaderText="Definition" SortExpression="DefText" />
<asp:BoundField DataField="AmplifyingExplanationText" HeaderText="Amplifying Explanation" SortExpression="AmplifyingExplanationText" />
<asp:BoundField DataField="SeeAlsoText" HeaderText="See Also" SortExpression="SeeAlsoText" />
<asp:BoundField DataField="AuthoritativeSrcText" HeaderText="Authoritative Source" SortExpression="AuthoritativeSrcText" />
<asp:BoundField DataField="ScopeName" HeaderText="Scope Name" SortExpression="ScopeName" />
<asp:BoundField DataField="DomnName" HeaderText="Domn Name" SortExpression="DomnName" />
<asp:BoundField DataField="GovernanceStateName" HeaderText="Governance State" SortExpression="GovernanceStateName" />
<asp:BoundField DataField="LastUpdtTimestamp" HeaderText="Last Update" SortExpression="LastUpdtTimestamp" />
</Columns>
</asp:GridView>
</form>
<script>
$(function () {
$('#<%=GridView1.ClientID%>').dataTable();
});
</script>
</body>
</html>
我正在尝试从 sql 源创建数据表,并且我希望能够使用 jquery 数据表过滤器过滤结果。有没有办法用我所拥有的来做到这一点?