void ControlTreeDataLoader.LoadData() { CssClass = CssClass.ConcatenateWithSpace(CssElementCreator.CssClass); var pagePath = EwfPage.Instance.InfoAsBaseType.ResourcePath; foreach (var resource in pagePath.Take(pagePath.Count - 1)) { Controls.Add(EwfLink.Create(resource, new ButtonActionControlStyle(resource.ResourceFullName, buttonSize: ButtonSize.ShrinkWrap))); Controls.Add(new PlaceHolder().AddControlsReturnThis(ResourceInfo.ResourcePathSeparator.ToComponents().GetControls())); } if (pageName != null) { Controls.Add(pageName); } else if (Controls.Count > 0) { Controls.RemoveAt(Controls.Count - 1); } }
/// <summary> /// EWL use only. Do not call if there is no authenticated user. /// </summary> public void LoadData(PageInfo changePasswordPage) { this.AddControlsReturnThis(("Logged in as " + AppTools.User.Email).ToComponents().GetControls()); if (!FormsAuthStatics.FormsAuthEnabled) { return; } this.AddControlsReturnThis( new LiteralControl(" "), EwfLink.Create(changePasswordPage, new TextActionControlStyle("Change password")), new LiteralControl(" • "), new PostBackButton( new TextActionControlStyle("Log out"), usesSubmitBehavior: false, postBack: PostBack.CreateFull( id: "ewfLogOut", firstModificationMethod: FormsAuthStatics.LogOutUser, actionGetter: () => { // NOTE: Is this the correct behavior if we are already on a public page? return(new PostBackAction(new ExternalResourceInfo(NetTools.HomeUrl))); }))); }