In this post I will explain how you can programmatically create a new WebPage and how you can put some content on the page.
First off all, how to programmatically create a new WebPage?
There is a default webpart (the ContentEditorWebPart) where you can put some Xml in.
Use following code to add content. It can be inserted just after the “pageItem.UpdateOverwriteVersion()” in the above method.
After you implemented all the code you should get a webpage with a webpart that looks like this (in edit-mode):