示例#1
0
    protected void CreateStaticPage()
    {
        if (!ValidateInput())
        {
            return;
        }
        var id = StaticPageService.AddStaticPage(new StaticPage
        {
            PageName = txtPageName.Text,
            PageText = fckPageText.Text,
            UrlPath  = txtSynonym.Text,
            ParentId = hfParentId.Value == "" ? 0 : Convert.ToInt32(hfParentId.Value),
            Meta     = new MetaInfo
            {
                Type            = MetaType.StaticPage,
                Title           = txtPageTitle.Text,
                MetaKeywords    = txtMetaKeywords.Text,
                MetaDescription = txtMetaDescription.Text
            },
            IndexAtSiteMap = chkIndexAtSitemap.Checked,
            HasChildren    = false,
            Enabled        = chkEnabled.Checked,
            SortOrder      = txtSortOrder.Text.TryParseInt()
        });

        Response.Redirect(string.Format("StaticPage.aspx?PageID={0}", id));
    }