62,268
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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></title>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#txtContent").keyup(function() {
if ($("#txtContent").val() != "") {
_Default.Bind();
}
})
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="txtContent" runat="server"></asp:TextBox>
<br />
<progresstemplate>
<asp:GridView ID="GridView1" runat="server" Visible="false">
</asp:GridView>
</progresstemplate>
</form>
</body>
</html>
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
}
[AjaxPro.AjaxMethod]
public void Bind()
{
//1:根据文本查询
//2:如果有查询结果 则gridview 显示
//3数据绑定到gridview
}
}