I am trying to add a SharePoint list to an AJAX Update Panel. I am doing this by adding a ListViewWebPart to the Update Panel. My code:
SPList fcsRequestList = web.Lists.TryGetList("Requests List"); ListViewWebPart lvWP = new ListViewWebPart(); lvWP.ZoneID = "Header"; lvWP.ListName = fcsRequestList.ID.ToString().ToUpper(); lvWP.ViewGuid = fcsRequestList.DefaultView.ID.ToString().ToUpper(); UpdatePanelRequestList.ContentTemplateContainer.Controls.Add(lvWP);
When I do this I get the error "< !-- #RENDER FAILED -- >"
I have tried using different views with no luck. Is there a way to solve this error or a better way to display a list in an Update Panel?
I am using SharePoint 2010. This is a Visual Web Part project that contains an Update Panel inside it, which then contains the code above.