SharePoint 2013 – Remove, Add and Update List View Web Parts on publishing pages programmatically

Changing Default Views Sergei Sergeev's post about changing default views helped a bit here However I found that when doing the same on publishing pages things become slightly trickier. I have looked at 3 different things that we could do to the ListViewWebPart: Delete Add Update The basic steps First for all of these operations … Continue reading SharePoint 2013 – Remove, Add and Update List View Web Parts on publishing pages programmatically

Advertisements

SharePoint 2013 – The specified view is invalid in call to LimitedWebPartManager.AddWebPart

My problem Today I tried to add a web part to a page using the following code: This gave me a "The specified view is invalid" Exception on the AddWebPart call. Your Solution Then I moved the following line: resulting in and the web part was added to the page with the correct view.