当我们在网页的文本框中写入一些数据时,在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); }