public AjaxContactForm(AjaxHelper ajaxHelper, PagePayload page, AjaxOptions ajaxOptions, object formAttributes = null) { _helper = ajaxHelper; if (page == null) { page = PagePayload.GetCurrentContent(); } if (ajaxOptions == null) { ajaxOptions = new AjaxOptions(); ajaxOptions.InsertionMode = InsertionMode.Replace; } if (String.IsNullOrEmpty(ajaxOptions.HttpMethod)) { ajaxOptions.HttpMethod = "POST"; } if (String.IsNullOrEmpty(ajaxOptions.UpdateTargetId)) { ajaxOptions.UpdateTargetId = "frmContact"; } if (String.IsNullOrEmpty(ajaxOptions.OnFailure)) { ajaxOptions.OnFailure = "__OnAjaxRequestFailure"; } string formAction = "Contact.ashx"; //try #3 //RouteValueDictionary dic = new RouteValueDictionary(); //dic.Add("controller", "CmsAjaxForms"); //dic.Add("action", formAction); //if (SecurityData.AdvancedEditMode) { // dic.Add(SiteData.AdvancedEditParameter, true); //} //frm = ajaxHelper.BeginRouteForm("Default", dic, ajaxOptions, formAttributes); //try #2 if (SecurityData.AdvancedEditMode) { frm = ajaxHelper.BeginRouteForm("Default", new { controller = "CmsAjaxForms", action = formAction, carrotedit = true }, ajaxOptions, formAttributes); } else { frm = ajaxHelper.BeginRouteForm("Default", new { controller = "CmsAjaxForms", action = formAction }, ajaxOptions, formAttributes); } /* * //try #1 * string formAction = "Contact.ashx"; * FormRouteValue frv = new FormRouteValue("CmsAjaxForms", formAction); * * if (SecurityData.AdvancedEditMode) { * frv = new FormRouteValue("CmsAjaxForms", formAction, true); * } * * frm = ajaxHelper.BeginRouteForm("Default", frv, ajaxOptions, formAttributes); */ }
public OpenGraph() { this.OpenGraphType = OpenGraphTypeDef.Default; this.ShowExpirationDate = false; this.CmsPage = PagePayload.GetContentFromViewData(); }
public SearchForm(HtmlHelper helper, PagePayload page, object formAttributes = null) { _helper = helper; var frmID = new TagBuilder("input"); frmID.MergeAttribute("type", "hidden"); frmID.MergeAttribute("name", "form_type"); frmID.MergeAttribute("value", "SearchForm"); var frmBuilder = new TagBuilder("form"); frmBuilder.MergeAttribute("action", page.TheSite.SiteSearchPath); frmBuilder.MergeAttribute("method", "GET"); //frmBuilder.MergeAttribute("action", page.ThePage.FileName); //frmBuilder.MergeAttribute("method", "POST"); var frmAttribs = (IDictionary <string, object>)HtmlHelper.AnonymousObjectToHtmlAttributes(formAttributes); frmBuilder.MergeAttributes(frmAttribs); string frmTag = frmBuilder.ToString(TagRenderMode.StartTag) //+ Environment.NewLine //+ helper.AntiForgeryToken().ToString() // only put in if using a post //+ Environment.NewLine //+ frmID.ToString(TagRenderMode.SelfClosing) + Environment.NewLine; _helper.ViewContext.Writer.Write(frmTag); }
protected void LoadPage(string Uri) { _page = PagePayload.GetContent(Uri); this.ViewData[PagePayload.ViewDataKey] = _page; this.TemplateFile = this.DisplayTemplateFile; }
private void EditAppBarButton_Click(object sender, RoutedEventArgs e) { var pagePayload = new PagePayload() { Dto = viewModel.Wallet }; Frame.Navigate(typeof(WalletEditPage), pagePayload); }
public SimpleList() { this.CssClass = String.Empty; this.CssSelected = "selected"; this.ElementId = "list"; this.CmsPage = PagePayload.GetContentFromViewData(); this.NavigationData = new List <SiteNav>(); }
private void GridViewCategories_ItemClick(object sender, ItemClickEventArgs e) { var category = (Category)e.ClickedItem;; var categoryPageDto = new PagePayload() { Dto = category }; Frame.Navigate(typeof(CategoryPage), categoryPageDto); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { MenuHelper.SetHeader(resources.GetString("Banks_PageTitle")); pagePayload = (PagePayload)e.Parameter; viewModel.Wallet = (Wallet)pagePayload.Dto; await viewModel.LoadDataAsync(); base.OnNavigatedTo(e); }
private void ListViewRules_ItemClick(object sender, ItemClickEventArgs e) { var rule = (Rule)e.ClickedItem; var pagePayload = new PagePayload() { Dto = viewModel.Category, Rule = rule }; Frame.Navigate(typeof(RulePage), pagePayload); }
private void AddRuleButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { //pagePayload.Dto = viewModel.Category; var pagePayload = new PagePayload() { Dto = viewModel.Category }; Frame.Navigate(typeof(RulePage), pagePayload); }
private void AddAppBarButton_Click(object sender, RoutedEventArgs e) { var pagePayload = new PagePayload() { Dto = new Category() { Name = resources.GetString("Category_CategoryDefaultName") } }; Frame.Navigate(typeof(CategoryPage), pagePayload); }
private void AddAppBarButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { var pagePayload = new PagePayload() { Dto = new Wallet() { Name = resources.GetString("Wallet_WalletDefaultName") } }; Frame.Navigate(typeof(WalletEditPage), pagePayload); }
private async void AddBankButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { if (viewModel.Modified) { await SaveWallet(); } var pagePayload = new PagePayload() { Dto = viewModel.Wallet }; Frame.Navigate(typeof(BanksPage), pagePayload); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { MenuHelper.SetHeader(resources.GetString("Category_PageTitle")); pagePayload = (PagePayload)e.Parameter; viewModel.Category = (Category)pagePayload.Dto; await viewModel.LoadDataAsync(); if (pagePayload.NewImage != null) { viewModel.Image = pagePayload.NewImage; } base.OnNavigatedTo(e); }
private async void ListViewCategories_ItemClick(object sender, ItemClickEventArgs e) { if (viewModel.Modified) { await SaveWallet(); } var category = (Category)e.ClickedItem; var pagePayload = new PagePayload() { Dto = category }; Frame.Navigate(typeof(CategoryPage), pagePayload); }
private async void ListViewBanks_ItemClick(object sender, ItemClickEventArgs e) { if (viewModel.Modified) { await SaveWallet(); } var bank = (Bank)e.ClickedItem; var pagePayload = new PagePayload() { Dto = bank }; Frame.Navigate(typeof(BankPage), pagePayload); }
protected void LoadPage() { if (_page == null) { if (this.ViewData[PagePayload.ViewDataKey] == null) { _page = PagePayload.GetCurrentContent(); this.ViewData[PagePayload.ViewDataKey] = _page; } else { _page = (PagePayload)this.ViewData[PagePayload.ViewDataKey]; } } this.TemplateFile = this.DisplayTemplateFile; }
public AjaxResetPasswordForm(AjaxHelper ajaxHelper, PagePayload page, AjaxOptions ajaxOptions, object formAttributes = null) { _helper = ajaxHelper; if (page == null) { page = PagePayload.GetCurrentContent(); } if (ajaxOptions == null) { ajaxOptions = new AjaxOptions(); ajaxOptions.InsertionMode = InsertionMode.Replace; } if (String.IsNullOrEmpty(ajaxOptions.HttpMethod)) { ajaxOptions.HttpMethod = "POST"; } if (String.IsNullOrEmpty(ajaxOptions.UpdateTargetId)) { ajaxOptions.UpdateTargetId = "frmResetPassword"; } if (String.IsNullOrEmpty(ajaxOptions.OnFailure)) { ajaxOptions.OnFailure = "__OnAjaxRequestFailure"; } string code = ResetPasswordInfoSettings.CodeUrl; string formAction = "ResetPassword.ashx"; if (SecurityData.AdvancedEditMode) { frm = ajaxHelper.BeginRouteForm("Default", new { controller = "CmsAjaxForms", action = formAction, @code = code, @carrotedit = true }, ajaxOptions, formAttributes); } else { frm = ajaxHelper.BeginRouteForm("Default", new { controller = "CmsAjaxForms", action = formAction, @code = code }, ajaxOptions, formAttributes); } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { MenuHelper.SetHeader(resources.GetString("Categories_PageTitle")); pagePayload = (PagePayload)e.Parameter; if (pagePayload != null) { CommandBar_Add.Visibility = Visibility.Collapsed; viewModel.Wallet = (Wallet)pagePayload?.Dto; } else { GridViewCategories.IsItemClickEnabled = true; CommandBar_Accept.Visibility = Visibility.Collapsed; CommandBar_Cancel.Visibility = Visibility.Collapsed; } await viewModel.LoadDataAsync(); base.OnNavigatedTo(e); }
public ActionResult Default(FormCollection model) { _page = PagePayload.GetCurrentContent(); Object frm = null; if (Request.Form["form_type"] != null) { string formMode = Request.Form["form_type"].ToString().ToLower(); if (formMode == "searchform") { frm = new SiteSearch(); frm = FormHelper.ParseRequest(frm, Request); this.ViewData["CMS_searchform"] = frm; if (frm != null) { this.TryValidateModel(frm); } } if (formMode == "contactform") { frm = new ContactInfo(); frm = FormHelper.ParseRequest(frm, Request); var cmt = (ContactInfo)frm; cmt.Root_ContentID = _page.ThePage.Root_ContentID; cmt.CreateDate = SiteData.CurrentSite.Now; cmt.CommenterIP = Request.ServerVariables["REMOTE_ADDR"]; this.ViewData[ContactInfo.Key] = frm; if (cmt != null) { this.TryValidateModel(cmt); } } } return(DefaultView()); }
public TableNode(int mip, int x, int y, int width, int height) { Rect = new RectInt(x, y, width, height); Payload = new PagePayload(); MaxMipLevel = mip; }
public OpenGraph(PagePayload pp) : this() { this.CmsPage = pp; }