I was able to follow along and add a Content Editor web part to a page using javascript from MSDN here. I am now interested in trying to find a way to add a List View or Data View web part to a page using javascript, just not sure if this is possible or where I could find more information about the web part definition piece.

appreciate any help with this. I have tried exporting a content query web part and deciphering the node names/ids, but ContentByQueryWebPart is not a type that can be imported using this approach. I have tried to find information of the definition piece but have not been able to find anything.

1 Answer 1


Add the List View Web Part to a page, set the properties how you want them, and then export the XML using the web part's dropdown menu. If Export isn't included in the menu, change the Export Mode property (Advanced tab) of the Web Part.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.