Bind DataGrid using ajax

不问归期 提交于 2019-12-25 17:04:35

问题


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.


回答1:


You should use LinkButton Instead

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>


来源:https://stackoverflow.com/questions/7200234/bind-datagrid-using-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!