📄 default.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>AutoComplete</title>
</head>
<body style="font-size: 12px; background-color: #F7F6F3;">
<form id="form1" runat="server">
<div style="text-align: center;">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<span style="font-size: 11pt; color: #990033"><strong>在线 成语词典</strong></span>
<br />
</div>
请输入要查询的关键字:<asp:TextBox ID="keyword" runat="server" autocomplete="off"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" ServicePath="PhraseService.asmx"
CompletionInterval="1000" EnableCaching="true" CompletionSetCount="12" ServiceMethod="Get"
TargetControlID="keyword" MinimumPrefixLength="1" runat="server">
</ajaxToolkit:AutoCompleteExtender>
<%-- //为form再添加一个submit,可防止其自动提交--%>
<asp:TextBox ID="TextBox1" runat="server" Style="display: none"></asp:TextBox>
<asp:Button ID="search" runat="server" Text="搜索"></asp:Button>
<br />
<br />
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<div style="color: Red; position: absolute; top: 10px; left: 800px; background-color: #333333;">
<h3>
正在更新数据.....</h3>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="ObjectDataSource1"
GridLines="None" Width="430px" CellPadding="4" ForeColor="#333333" PageSize="6">
<Columns>
<asp:BoundField DataField="Name" HeaderText="名称" SortExpression="Name">
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField DataField="pronunciation" HeaderText="发音" SortExpression="pronunciation">
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField DataField="paraphrase" HeaderText="解释" SortExpression="paraphrase">
<ItemStyle Width="215px" />
</asp:BoundField>
</Columns>
<EmptyDataTemplate>
没有找到您要的成语。
</EmptyDataTemplate>
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger EventName="Click" ControlID="search" />
</Triggers>
</asp:UpdatePanel>
<br />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPhrase"
TypeName="Phrase">
<SelectParameters>
<asp:ControlParameter ControlID="keyword" DefaultValue="一" Name="name" PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -