1

我想使用 Sitefinity API 以编程方式创建一个页面,我知道要编写哪个代码,但我不知道要创建或编辑哪个文件来插入此代码,请帮助我,这是我要插入的代码, 提前致谢:

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

Telerik.Cms.ICmsPage newPage = cmsManager.CreatePage("关于我们");

cmsManager.SavePage(newPage);

4

1 回答 1

1

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"

于 2012-08-28T15:09:45.037 回答