I know its possible to create a wiki page in a sandbox solution with this:
SPUtility.CreateNewWikiPage(list, "{mysiteurl}/CodeGeneratedPage.aspx");
But how can I (if possible) create a webpart page with included webpart in my document library? Because all I can find (like this) is only working in farm solutions. Is there a workaround somehow?
Notice: I post this question here because there are way more people here as on the Sharepoint site.
Good find. You cannot use the
SPLimitedWebPartManager
in sandboxed code and hence can't use it to put WebParts on pages.The only way to provision WebParts to pages is the declarative way (i.e. XML), so you will have to do something like this in an
elements.xml
file:These links will help you along your way:
and some more: