Beispiel #1
0
 protected void btnSave_Click(object sender, System.EventArgs e)
 {
     CMS.Content text = CMS.ContentService.GetContent(ContentName);
     if (!text.IsLoaded)
     {
         text.IsNew       = true;
         text.ContentGUID = Guid.NewGuid();
     }
     text.Locale      = LocaleList.SelectedValue;
     text.ContentName = ContentName;
     text.Body        = txtContent.Value;
     text.Save(Page.User.Identity.Name);
     ResultMessage1.ShowSuccess("Content Saved");
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (ContentName != string.Empty)
     {
         CMS.Content text = CMS.ContentService.GetContent(contentName);
         if (text.IsLoaded)
         {
             ContentText = text.Body;
         }
     }
     else
     {
         ContentText = "Set both the ContentID and PageName";
     }
 }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ContentName = SubSonic.Utilities.Utility.GetParameter("id");
        if (!Page.IsPostBack)
        {
            if (ContentName != string.Empty)
            {
                CMS.Content text = CMS.ContentService.GetContent(ContentName);
                if (text.Body != null)
                {
                    txtContent.Value = text.Body;
                }
            }

            //load the locale list
            string [] locales = Enum.GetNames(typeof(CMS.SupportedLocales));
            foreach (string s in locales)
            {
                string localeName = s.Replace("_", "-");
                LocaleList.Items.Add(new ListItem(localeName));
            }
        }
    }