如何使用“文本框"和"Gridview"表在“更新"面板中显示数据? [英] How to display data in Update panel with Textbox and Gridview table ?

查看:109
本文介绍了如何使用“文本框"和"Gridview"表在“更新"面板中显示数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


有一个Textbox和Gridview数据库.文本框已针对搜索框进行了textchanged事件.当文本框中有任何文本并按搜索"按钮时,数据将显示在Gridview表中.文本框的工作方式类似于Google搜索功能.
当我们输入文本并搜索时,数据显示在girdview中,但整个页面都会刷新.因此,如何使用更新面板(在Ajax中)做到这一点,这样我们就可以在不刷新整个页面的情况下获得结果.
Gridview显示来自SQL数据库的数据.

如果您需要更多详细信息,请回复我.

在此先感谢

Hi,
There is one Textbox and Gridview databasse. The Textbox have textchanged event for search box. When there is any text in textbox and pressing the Search button the data is displayed in Gridview table. Textbox is working like Google search functionality.
When we enter the text and search the data is displayed in girdview but whole page is refreshed. So how to do it with update panel (in Ajax) so we can get the result without refreshing the whole page.
Gridview display the data from SQL database.

Reply me if you require any more details.

Thanks in advance

推荐答案

我认为您只需要放置一个脚本管理器和一个更新面板,然后在内容模板中放置文本框和网格视图即可正常工作.
i think you simply need to place a script manager and one update panel and in content template place both text box and grid view it will work fine.


关注此:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" ></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="btn" onclick="Button1_Click" /><br />
                <asp:GridView ID="GridView1" runat="server"></asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>



希望对您有帮助.
如果有帮助,请不要忘记将其标记为答案. :)



Hope it will help you.
Don''t forget to mark as answer if it helps. :)


这篇关于如何使用“文本框"和"Gridview"表在“更新"面板中显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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