Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
I think technically a WebPart has to live directly within a WebPartZone, but I may be wrong about this. –  RJ Cuthbertson Jul 30 '12 at 20:47
    
If so, can I add an Update Panel to the web part zone and add the list inside that panel? –  Meyer Denney Jul 30 '12 at 20:49
    
I don't believe you can have any intermediary containers. I believe it has to live directly within the WebPartZone. –  RJ Cuthbertson Jul 30 '12 at 20:51
    
I clarified in my post that this is a Visual Web Part project that I am adding to the Header zone of a Web Part page. So this is an Update Panel, inside a Visual Web Part that is placed in a Web Part zone. –  Meyer Denney Jul 30 '12 at 20:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.