像这样:
<asp:UpdatePanel ID="updPnlTabs" runat="server" >
<Triggers>
<asp:PostBackTrigger ControlID="btnPersonalInfo" />
<asp:PostBackTrigger ControlID="btnMobileInfo" />
<asp:PostBackTrigger ControlID="btnDocuments" />
</Triggers>
<asp:GridView runat="server" ID="ucLAD"/>
<asp:Button Text="Personal Info" ID="btnPersonalInfo" runat="server" Onclick="btnPersonalInfo_Click" />
<asp:Button Text="Mobile Info" ID="btnMobileInfo" runat="server" Onclick="btnMobileInfo_Click" />
<asp:Button Text="Documents" ID="btnDocuments" runat="server" Onclick="btnDocuments_Click" />
</asp:UpdatePanel>
现在,要更新您的 GridView,请将您的脚本放在OnClick
操作或方法上,如下所示:
protected void btnPersonalInfo_Click(object sender, EventArgs e)
{
// your action here to update your GridView
}
protected void btnMobileInfo_Click(object sender, EventArgs e)
{
// your action here to update your GridView
}
protected void btnDocuments_Click(object sender, EventArgs e)
{
// your action here to update your GridView
}