当我们在网页的文本框中写入一些数据时,在gridview中显示记录. [英] show records in a gridview when we write some data in textbox in a webpage.

查看:80
本文介绍了当我们在网页的文本框中写入一些数据时,在gridview中显示记录.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

当我在文本框中写一些值时,我有一个文本框和gridview,它的相应记录将显示在Gridview中.


感谢

Hi all,

I have a textbox and gridview when i write some value in textbox ,its corresponding records will be shown in the Gridview.


Thanks

推荐答案

文本框的整体,您可以进行jQuery.ajax调用以从服务器端获取数据,然后可以在GridView中呈现这些数据.

如果需要的话,您也可以给计时器定一个时间,例如在onblur给出5秒钟后,再获取记录并刷新gridview.
onblur of your text box you can make an jQuery.ajax call to fetch the data from the server side and then you can render those data in GridView.

If you want then you can give some timer as well say after onblur give 5 sec then fetch the record and refresh the gridview.


search.aspx
search.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <input type="text" id="txtSearch" /> 
    </div>
    <div id="gridPanel">
    </div>
    </form>
</body>
</html>

</html>


//used jquery plz put the reference of jquery file
//Search method to search , bind grid with data, and load the grid page.
function search (txt){
    //getting search Parameters as an JSON object.
    var searchParams = {"Name" : txt};
    //calling HTTP post ajax to load the gridview page in div.


(" ).load( " ,searchParams); }
("#gridPanel").load("gridview.aspx",searchParams); }


这篇关于当我们在网页的文本框中写入一些数据时,在gridview中显示记录.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆