Hi setwell,
You can only trigger the parent controlId. In your condition you are triggering parent and child controlId therefore your updatePanel is not firing.
Please refer below sample.
HTML
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="FruitName" HeaderText="Fruit Name" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkPartial" runat="server" Text="Partial PostBack" OnClick="PartialPostBack" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkFull" runat="server" Text="Full PostBack" OnClick="FullPostBack" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:LinkButton ID="lnkFruit" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="GridView1" />
<asp:AsyncPostBackTrigger ControlID="lnkFruit" />
</Triggers>
</asp:UpdatePanel>
Namespace
using System.Data;
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.Add("FruitName");
dt.Rows.Add("Apple");
dt.Rows.Add("Mango");
dt.Rows.Add("Banana");
dt.Rows.Add("Orange");
dt.Rows.Add("Pineapple");
GridView1.DataSource = dt;
GridView1.DataBind();
}
this.RegisterPostBackControl();
}
private void RegisterPostBackControl()
{
foreach (GridViewRow row in GridView1.Rows)
{
LinkButton lnkFull = row.FindControl("lnkFull") as LinkButton;
ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkFull);
}
}
protected void PartialPostBack(object sender, EventArgs e)
{
string fruitName = ((sender as LinkButton).NamingContainer as GridViewRow).Cells[0].Text;
string message = "alert('Partial PostBack: You clicked " + fruitName + "');";
ScriptManager.RegisterClientScriptBlock(sender as Control, this.GetType(), "alert", message, true);
}
protected void FullPostBack(object sender, EventArgs e)
{
string fruitName = ((sender as LinkButton).NamingContainer as GridViewRow).Cells[0].Text;
string message = "alert('Full PostBack: You clicked " + fruitName + "');";
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", message, true);
}