使用ajax绑定DataGrid [英] Bind DataGrid using ajax
本文介绍了使用ajax绑定DataGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用Ajax设置数据网格视图的数据源?我的目标是在单击超链接(在同一页面中)时绑定一个数据网格。请帮忙。
Is it possible to set the datasource of a datagrid view using ajax? My objective is to bind a datagrid on clicking a hyperlink(in the same page). Please help.
推荐答案
您应使用 LinkButton
代替
protected void LinkButton1_Click(object sender, EventArgs e)
{
// set DataSource here .....
}
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%-- GridView--%>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
这篇关于使用ajax绑定DataGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文