private bool Save() { if (Page.IsValid) { LayoutHelper.CreateAndSave(Server.MapPath(_Layout.FilePath), Description.Text, HeaderControlsDialog.SelectedControls, LeftControlsDialog.SelectedControls, RightControlsDialog.SelectedControls, FooterControlsDialog.SelectedControls); SavedMessage.Text = string.Format(SavedMessage.Text, LocaleHelper.LocalNow.ToShortTimeString()); SavedMessage.Visible = true; return(true); } return(false); }
private bool Save() { if (Page.IsValid) { // // CHECK IF A FILE WITH THE GIVEN NAME ALREADY EXISTS string layoutName = LayoutName.Text; layoutName = layoutName.Replace(" ", " ") + ".master"; string layoutPath = Server.MapPath("~/Layouts/" + layoutName); if (!File.Exists(layoutPath)) { LayoutHelper.CreateAndSave(layoutPath, Description.Text, HeaderControlsDialog.SelectedControls, LeftControlsDialog.SelectedControls, RightControlsDialog.SelectedControls, FooterControlsDialog.SelectedControls); SavedMessage.Text = string.Format(SavedMessage.Text, LocaleHelper.LocalNow.ToShortTimeString()); SavedMessage.Visible = true; return(true); } else { ExistingLayoutNameValidator.IsValid = false; } } return(false); }