I am having a problem updating a listview’s databinding when inside a update panel. The listview is to do a databind and return some user names.
I have tested the databind by triggering it from an asp button and it works fine like so.
protected void getFacebookFriends(object sender, EventArgs e)
{
List<testResult> getFriends = (from i in lqDataContext.test(base.UserId) select i).ToList();
lvFacebookFriends.DataSource = getFriends;
lvFacebookFriends.DataBind();
}
when I try do this via ajax using
<telerik:RadAjaxPanel ID="updateFriends" runat="server" OnAjaxRequest="updateFriends_AjaxRequest">
function invokeAjaxRequest() {
$find("<%= updateFriends.ClientID%>").ajaxRequestWithTarget("<%= updateFriends.UniqueID %>", 97);
}
protected void updateFriends_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
List getFriends = (from i in lqDataContext.test(base.UserId) select i).ToList();
lvFacebookFriends.DataSource = getFriends;
lvFacebookFriends.DataBind();
updateFriends.EnableAJAX = false;
}
I can see in debug that I get through updateFriends_AjaxRequest without error but the ui has not change.
Thanks for helping me understand this.
Mark
Just wrap it in a regular update panel. The postback will be caught and the listview will re-render with the new information asynchronously.