本文整理汇总了C#中Carrotware.CMS.Core.ContentPage.SavePageEdit方法的典型用法代码示例。如果您正苦于以下问题:C# ContentPage.SavePageEdit方法的具体用法?C# ContentPage.SavePageEdit怎么用?C# ContentPage.SavePageEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carrotware.CMS.Core.ContentPage
的用法示例。
在下文中一共展示了ContentPage.SavePageEdit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
pageContents = new ContentPage(SiteID, ContentPageType.PageType.ContentEntry);
DateTime dtSite = CMSConfigHelper.CalcNearestFiveMinTime(SiteData.CurrentSite.Now);
int iOrder = pageHelper.GetMaxNavOrder(SiteID) + 1;
Guid? parentContentID = ParentPagePicker.SelectedPage;
pageContents.Parent_ContentID = parentContentID;
pageContents.TitleBar = txtTitle.Text;
pageContents.NavMenuText = txtNav.Text;
pageContents.PageHead = txtHead.Text;
pageContents.FileName = txtFileName.Text;
pageContents.MetaDescription = txtDescription.Text;
pageContents.MetaKeyword = txtKey.Text;
pageContents.Heartbeat_UserId = SecurityData.CurrentUserGuid;
pageContents.EditHeartbeat = dtSite.AddMinutes(5);
pageContents.EditUserId = SecurityData.CurrentUserGuid;
pageContents.IsLatestVersion = true;
pageContents.EditDate = SiteData.CurrentSite.Now;
pageContents.NavOrder = iOrder;
pageContents.PageActive = false;
pageContents.ShowInSiteMap = true;
pageContents.ShowInSiteNav = true;
pageContents.ContentType = ContentPageType.PageType.ContentEntry;
pageContents.GoLiveDate = dtSite;
pageContents.RetireDate = dtSite.AddYears(200);
pageContents.SavePageEdit();
pnlAdd.Visible = false;
pnlSaved.Visible = true;
litPageName.Text = pageContents.FileName;
lnkNew.NavigateUrl = pageContents.FileName;
if (pageContents.FileName.ToLowerInvariant().EndsWith(SiteData.DefaultDirectoryFilename)) {
VirtualDirectory.RegisterRoutes(true);
}
Master.ShowSave();
}
示例2: CreateEmptyHome
private void CreateEmptyHome() {
DateTime dtSite = CMSConfigHelper.CalcNearestFiveMinTime(SiteData.CurrentSite.Now);
ContentPage pageContents = new ContentPage {
SiteID = SiteID,
Root_ContentID = Guid.NewGuid(),
ContentID = Guid.NewGuid(),
EditDate = SiteData.CurrentSite.Now,
CreateUserId = SecurityData.CurrentUserGuid,
CreateDate = SiteData.CurrentSite.Now,
GoLiveDate = dtSite.AddMinutes(-5),
RetireDate = dtSite.AddYears(200),
TitleBar = "Home",
NavMenuText = "Home",
PageHead = "Home",
FileName = "/home",
PageText = SiteData.StarterHomePageSample,
LeftPageText = String.Empty,
RightPageText = String.Empty,
NavOrder = 0,
IsLatestVersion = true,
PageActive = true,
ShowInSiteNav = true,
ShowInSiteMap = true,
BlockIndex = false,
EditUserId = SecurityData.CurrentUserGuid,
ContentType = ContentPageType.PageType.ContentEntry,
TemplateFile = SiteData.DefaultTemplateFilename
};
pageContents.SavePageEdit();
}
示例3: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
SiteData site = siteHelper.GetCurrentSite();
string sDatePatternOld = "yy-MM-dd";
string sTimezoneOld = "ZZZ";
if (site == null) {
site = new SiteData();
site.SiteID = SiteID;
}
if (site != null) {
sDatePatternOld = site.Blog_DatePattern;
sTimezoneOld = site.TimeZoneIdentifier;
site.SiteName = txtSiteName.Text;
site.SiteTagline = txtTagline.Text;
site.SiteTitlebarPattern = txtTitleBar.Text;
site.MainURL = txtURL.Text;
site.MetaKeyword = txtKey.Text;
site.MetaDescription = txtDescription.Text;
site.BlockIndex = chkHide.Checked;
site.SendTrackbacks = chkSendTrackback.Checked;
site.AcceptTrackbacks = chkAcceptTrackbacks.Checked;
site.TimeZoneIdentifier = ddlTimeZone.SelectedValue;
site.Blog_FolderPath = txtFolderPath.Text;
site.Blog_CategoryPath = txtCategoryPath.Text;
site.Blog_DatePath = txtDatePath.Text;
site.Blog_TagPath = txtTagPath.Text;
site.Blog_EditorPath = txtEditorPath.Text;
site.Blog_DatePattern = ddlDatePattern.SelectedValue;
site.Blog_Root_ContentID = ParentPagePicker.SelectedPage;
}
site.Save();
if (sDatePatternOld != ddlDatePattern.SelectedValue || sTimezoneOld != ddlTimeZone.SelectedValue) {
using (ContentPageHelper cph = new ContentPageHelper()) {
cph.BulkBlogFileNameUpdateFromDate(SiteID);
}
}
if (!bNewSite) {
Response.Redirect(SiteData.CurrentScriptName);
} else {
DateTime dtSite = CalcNearestFiveMinTime(SiteData.CurrentSite.Now);
if (chkHomepage.Checked) {
ContentPage pageContents = new ContentPage {
SiteID = SiteID,
Root_ContentID = Guid.NewGuid(),
ContentID = Guid.NewGuid(),
EditDate = SiteData.CurrentSite.Now,
CreateUserId = SecurityData.CurrentUserGuid,
CreateDate = SiteData.CurrentSite.Now,
GoLiveDate = dtSite.AddMinutes(-5),
RetireDate = dtSite.AddYears(200),
TitleBar = "Home",
NavMenuText = "Home",
PageHead = "Home",
FileName = "/home.aspx",
PageText = SiteData.StarterHomePageSample,
LeftPageText = String.Empty,
RightPageText = String.Empty,
NavOrder = 0,
IsLatestVersion = true,
PageActive = true,
ShowInSiteNav = true,
ShowInSiteMap = true,
BlockIndex = false,
EditUserId = SecurityData.CurrentUserGuid,
ContentType = ContentPageType.PageType.ContentEntry,
TemplateFile = SiteData.DefaultTemplateFilename
};
pageContents.SavePageEdit();
}
Response.Redirect(SiteFilename.DashboardURL);
}
}