如何在按钮单击时绑定网格视图,而不加载页面。 [英] How to bind grid view while button click, with out page loading.
本文介绍了如何在按钮单击时绑定网格视图,而不加载页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在点击按钮时从数据库中显示gridview中的数据,注意:没有页面加载
我尝试过:
I want to display datas in a gridview from database while button is clicked,Note:With out page load
What I have tried:
<pre><pre> <div>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" />
<asp:BoundField DataField="Name" HeaderText="NAME" />
<asp:BoundField DataField="Address" HeaderText="ADDRESS" />
</Columns>
</asp:GridView>
<asp:Label ID="Label1" runat="server" Text="Click the Button To Bind the Data's in a Gridview"></asp:Label><br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click"></asp:Button>
</div>
推荐答案
使用 UpdatePanel控件 [ ^ ]
在Asp.net的Updatepanel示例中绑定Gridview [ ^ ]
这篇关于如何在按钮单击时绑定网格视图,而不加载页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文