Came across this issue today for a LinkButton I was using inside a repeater control which was inside an UpdatePanel. It turns out that a LinkButton does not automatically cause partial page rendering in this situation. To solve this issue you need to register the LinkButton inside the Repeater for Asynchronous Postback.
rptSearchList.DataSource = loPagedDataSource;
rptSearchList.DataBind();
//Initialize link button for ajax
foreach (RepeaterItem loItem in rptSearchList.Items){
if (loItem.ItemType == ListItemType.Item || loItem.ItemType == ListItemType.AlternatingItem){
LinkButton lbFavourites = (LinkButton)loItem.FindControl("lbFavourites");
ScriptManager ScriptManager1 = (ScriptManager)FindControlRecursive(this.Page, "ScriptManager1");
ScriptManager1.RegisterAsyncPostBackControl(lbFavourites);
}
}
The above code first finds the LinkButton based on its ID within the repeater control. In my example I have added one further step as my Repeater was part of a UserControl sitting within a MasterPage. The MasterPage held the ScriptManager so I used a method for finding the ScriptManager from the user control. The below code is a useful method I used to find the ScriptManager.
public static Control FindControlRecursive(Control controlToStartFrom, string ctrlIdToFind){
Control found = controlToStartFrom.FindControl(ctrlIdToFind);
if (found != null)
return found;
foreach (Control innerCtrl in controlToStartFrom.Controls){
found = FindControlRecursive(innerCtrl, ctrlIdToFind);
if (found != null)
return found;
}
return null;
}