Create a page programmatically with Sitefinity API

1k Views Asked by At

I want to create a page programmatically with the Sitefinity API, i know which code to write, but i don't know which file to create or to edit to insert this code, please help me, this is the code that i want to insert, thanks in advance:

Telerik.Cms.CmsManager cmsManager = new Telerik.Cms.CmsManager();

Telerik.Cms.ICmsPage newPage = cmsManager.CreatePage("About us");

cmsManager.SavePage(newPage);

1

There are 1 best solutions below

1
On

I got the answer (From Josh Morales) "it depends what you are trying to accomplish. You could put execute this on a blank webforms page (create a test.aspx page and put it in the code behind) and run that page to execute it. You can also place it in a user control (ascx file) as a widget and drop it on a page to run it. Alternatively you could wrap it in a module, but this is more advanced and probably only necessary if you need something reusable. For more on module creation take a look at the testimonials intra site module example: http://www.sitefinity.com/documentation/documentationarticles/developers-guide/how-to/how-to-create-a-testimonials-intra-site-module"