protected void AddPageTypeRight_Click(object sender, EventArgs e) { CurrentRule.PageTypeRight += HttpUtility.UrlEncode(RulePageTypeRight.SelectedValue + ";"); RulePageTypesRightLiteral.Text = HttpUtility.UrlDecode(CurrentRule.PageTypeRight); RulePageTypesRightListBox.DataSource = HttpUtility.UrlDecode(CurrentRule.PageTypeRight).Split(';'); RulePageTypesRightListBox.DataBind(); }
protected void RemovePageTypeRight_Click(object sender, EventArgs e) { string pageTypesRemoved = RemovePageType(RulePageTypesRightLiteral.Text, RulePageTypesRightListBox.SelectedValue); RulePageTypesRightLiteral.Text = pageTypesRemoved; RulePageTypesRightListBox.DataSource = pageTypesRemoved.Split(';'); RulePageTypesRightListBox.DataBind(); }
public void SetupEditControls() { if (CurrentRule != null && CurrentRule.Id != null) { RuleId.Text = CurrentRule.Id.ToString(); RuleName.Text = CurrentRule.RuleName; RulePageTypesLeftLiteral.Text = HttpUtility.UrlDecode(CurrentRule.PageTypeLeft); RulePageTypesRightLiteral.Text = HttpUtility.UrlDecode(CurrentRule.PageTypeRight); if (string.IsNullOrEmpty(CurrentRule.PageTypeLeft) == false) { RulePageTypesLeftListBox.DataSource = HttpUtility.UrlDecode(CurrentRule.PageTypeLeft).Split(';'); } else { RulePageTypesLeftListBox.Items.Clear(); } RulePageTypesLeftListBox.DataBind(); if (string.IsNullOrEmpty(CurrentRule.PageTypeRight) == false) { RulePageTypesRightListBox.DataSource = HttpUtility.UrlDecode(CurrentRule.PageTypeRight).Split(';'); } else { RulePageTypesRightListBox.Items.Clear(); } RulePageTypesRightListBox.DataBind(); RuleTextLeft.Text = CurrentRule.RuleTextLeft; RuleTextRight.Text = CurrentRule.RuleTextRight; if (GetPage(CurrentRule.RelationHierarchyStartLeft) != null) { RuleHierarchyStartPageReferenceLeft.PageLink = new EPiServer.Core.PageReference(CurrentRule.RelationHierarchyStartLeft); } else { RuleHierarchyStartPageReferenceLeft.PageLink = PageReference.StartPage; } if (GetPage(CurrentRule.RelationHierarchyStartRight) != null) { RuleHierarchyStartPageReferenceRight.PageLink = new EPiServer.Core.PageReference(CurrentRule.RelationHierarchyStartRight); } else { RuleHierarchyStartPageReferenceRight.PageLink = PageReference.StartPage; } VisibleLeft.Checked = CurrentRule.RuleVisibleLeft; VisibleRight.Checked = CurrentRule.RuleVisibleRight; RuleDescriptionLeft.Text = CurrentRule.RuleDescriptionLeft; RuleDescriptionRight.Text = CurrentRule.RuleDescriptionRight; SortOrderLeft.SelectedIndex = SortOrderLeft.Items.IndexOf(SortOrderLeft.Items.FindByValue(((FilterSortOrder)CurrentRule.SortOrderLeft).ToString())); SortOrderRight.SelectedIndex = SortOrderRight.Items.IndexOf(SortOrderRight.Items.FindByValue(((FilterSortOrder)CurrentRule.SortOrderRight).ToString())); AccessLevelDropDownList.SelectedIndex = AccessLevelDropDownList.Items.IndexOf(AccessLevelDropDownList.Items.FindByValue(CurrentRule.EditModeAccessLevel)); RulesRepeater.DataBind(); } }