protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); lblCurrentTime.Text = DateTimeHelper.ConvertToUserTime(DateTime.Now).ToString("F"); } string title = GetLocaleResourceString("PageTitle.Boards.Default"); SEOHelper.RenderTitle(this, title, true); }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { this.BindData(); } }
protected void rptrTagCloud_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { var blogPostTag = e.Item.DataItem as BlogPostTag; var hlLink = e.Item.FindControl("hlLink") as HyperLink; if (hlLink != null) { hlLink.NavigateUrl = SEOHelper.GetBlogUrlForTag(blogPostTag.Name); hlLink.Font.Size = new FontUnit(GetFontSize(blogPostTag.BlogPostCount), UnitType.Percentage); } } }
protected void Page_Load(object sender, EventArgs e) { if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !this.CustomerService.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (this.Cart.Count == 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } }
protected override void OnInit(EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } BindOrders(); BindRecurringPayments(); base.OnInit(e); }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (!SettingManager.GetSettingValueBoolean("Checkout.UseOnePageCheckout")) { Response.Redirect("~/checkout.aspx"); } string title = GetLocaleResourceString("PageTitle.CheckoutOnePage"); SEOHelper.RenderTitle(this, title, true); }
protected void Checkout() { ApplyCheckoutAttributes(); if (NopContext.Current.User == null || NopContext.Current.User.IsGuest) { string loginURL = SEOHelper.GetLoginPageUrl(true, this.CustomerService.AnonymousCheckoutAllowed); Response.Redirect(loginURL); } else { Response.Redirect("~/checkout.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //TODO: hard code catagory ID hplStringOrchestra.NavigateUrl = SEOHelper.GetCategoryUrl(int.Parse(ConfigurationManager.AppSettings["CategoryStringOrchestra"].ToString())); hplFullOrchestra.NavigateUrl = SEOHelper.GetCategoryUrl(int.Parse(ConfigurationManager.AppSettings["CatagoryFullOrchestra"].ToString())); hplBand.NavigateUrl = SEOHelper.GetCategoryUrl(int.Parse(ConfigurationManager.AppSettings["CatagoryBand"].ToString())); hplChoral_Vocal.NavigateUrl = SEOHelper.GetCategoryUrl(int.Parse(ConfigurationManager.AppSettings["CatagoryChoral_Vocal"].ToString())); hplInstr_Solos_Ensembles.NavigateUrl = SEOHelper.GetCategoryUrl(int.Parse(ConfigurationManager.AppSettings["CatagoryInstrumentalSolos_Ensembles"].ToString())); hplPiano.NavigateUrl = SEOHelper.GetCategoryUrl(int.Parse(ConfigurationManager.AppSettings["CatagoryPiano"].ToString())); } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (!ProductManager.RecentlyViewedProductsEnabled) { Response.Redirect(CommonHelper.GetStoreLocation()); } string title = GetLocaleResourceString("PageTitle.RecentlyViewedProducts"); SEOHelper.RenderTitle(this, title, true); }
private void BindData() { var forumGroup = ForumManager.GetForumGroupById(this.ForumGroupId); if (forumGroup != null) { hlForumGroup.NavigateUrl = SEOHelper.GetForumGroupUrl(forumGroup); hlForumGroup.Text = Server.HtmlEncode(forumGroup.Name); } rptrForumList.DataSource = forumGroup.Forums; rptrForumList.DataBind(); }
private string RenderMonths(SortedDictionary <DateTime, int> Months) { if (Months.Keys.Count == 0) { return(string.Empty); } HtmlGenericControl ul = new HtmlGenericControl("ul"); ul.Attributes.Add("id", "blogMonthList"); HtmlGenericControl year = null; HtmlGenericControl list = null; int current = 0; foreach (DateTime date in Months.Keys) { if (current == 0) { current = date.Year; } if (date.Year > current || ul.Controls.Count == 0) { list = new HtmlGenericControl("ul"); list.ID = "year" + date.Year.ToString(); year = new HtmlGenericControl("li"); year.Attributes.Add("class", "year"); year.InnerHtml = date.Year.ToString(); year.Controls.Add(list); ul.Controls.AddAt(0, year); } HtmlGenericControl li = new HtmlGenericControl("li"); HtmlAnchor anc = new HtmlAnchor(); string url = SEOHelper.GetBlogUrlByMonth(date); anc.HRef = url; anc.InnerHtml = new DateTime(date.Year, date.Month, 1).ToString("MMMM") + " (" + Months[date] + ")"; li.Controls.Add(anc); list.Controls.AddAt(0, li); current = date.Year; } StringWriter sw = new StringWriter(); ul.RenderControl(new HtmlTextWriter(sw)); return(sw.ToString()); }
private void WriteCategories(int ParentCategoryID) { CategoryCollection categories = CategoryManager.GetAllCategories(ParentCategoryID, false); foreach (Category category in categories) { string url = SEOHelper.GetCategoryURL(category.CategoryID); UpdateFrequency updateFrequency = UpdateFrequency.weekly; DateTime updateTime = category.UpdatedOn; WriteUrlLocation(url, updateFrequency, updateTime); WriteCategories(category.CategoryID); } }
protected void dlProducts_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var product = e.Item.DataItem as Product; var hlLink = e.Item.FindControl("hlLink") as HyperLink; if (hlLink != null) { hlLink.NavigateUrl = SEOHelper.GetProductUrl(product); hlLink.Text = Server.HtmlEncode(product.LocalizedName); } } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (!SettingManager.GetSettingValueBoolean("Common.EnableWishlist")) { Response.Redirect(CommonHelper.GetStoreLocation()); } string title = GetLocaleResourceString("PageTitle.Wishlist"); SEOHelper.RenderTitle(this, title, true); if (!Page.IsPostBack) { Customer customer = CustomerManager.GetCustomerByGuid(this.CustomerGuid.HasValue ? this.CustomerGuid.Value : Guid.Empty); if (customer != null) { lTitle.Text = string.Format(GetLocaleResourceString("Wishlist.WishlistOf"), Server.HtmlEncode(customer.FullName), Server.HtmlEncode(customer.Email)); CustomerSession customerSession = CustomerManager.GetCustomerSessionByCustomerId(customer.CustomerId); if (customerSession != null) { ctrlWishlist.CustomerSessionGuid = customerSession.CustomerSessionGuid; } ctrlWishlist.IsEditable = false; ctrlWishlist.BindData(); } else { lTitle.Text = GetLocaleResourceString("Wishlist.YourWishlist"); if (NopContext.Current.Session != null) { ctrlWishlist.CustomerSessionGuid = NopContext.Current.Session.CustomerSessionGuid; } ctrlWishlist.IsEditable = true; ctrlWishlist.BindData(); if (NopContext.Current.User != null && !NopContext.Current.User.IsGuest) { lblYourWishlistURL.Visible = true; lnkWishListUrl.Visible = true; lblYourWishlistURL.Text = GetLocaleResourceString("Wishlist.YourWishlistURL"); string wishListUrl = SEOHelper.GetWishlistUrl(); wishListUrl = CommonHelper.ModifyQueryString(wishListUrl, "CustomerGUID=" + NopContext.Current.User.CustomerGuid.ToString(), null); lnkWishListUrl.NavigateUrl = wishListUrl; lnkWishListUrl.Text = wishListUrl; } } } }
private void WriteCategories(int parentCategoryId) { var categories = CategoryManager.GetAllCategoriesByParentCategoryId(parentCategoryId, false); foreach (var category in categories) { var url = SEOHelper.GetCategoryUrl(category); var updateFrequency = UpdateFrequency.Weekly; var updateTime = category.UpdatedOn; WriteUrlLocation(url, updateFrequency, updateTime); WriteCategories(category.CategoryId); } }
protected void rptrSubCategories_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { var category = e.Item.DataItem as Category; var hlCategory = e.Item.FindControl("hlCategory") as HyperLink; if (hlCategory != null) { hlCategory.NavigateUrl = SEOHelper.GetCategoryUrl(category.CategoryId); hlCategory.ToolTip = String.Format(GetLocaleResourceString("Media.Category.ImageLinkTitleFormat"), category.Name); hlCategory.Text = Server.HtmlEncode(category.Name); } } }
protected void dlCategories_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var category = e.Item.DataItem as Category; var hlLink = e.Item.FindControl("hlLink") as HyperLink; if (hlLink != null) { hlLink.NavigateUrl = SEOHelper.GetCategoryUrl(category); hlLink.Text = Server.HtmlEncode(category.LocalizedName); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); } Topic topic = TopicManager.GetTopicByID(this.TopicID); string title = CommonHelper.IIF(!string.IsNullOrEmpty(topic.MetaTitle), topic.MetaTitle ?? String.Empty, topic.Name ?? String.Empty); SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", topic.MetaDescription ?? String.Empty, true); SEOHelper.RenderMetaTag(this, "keywords", topic.MetaKeywords ?? String.Empty, true); }
protected void dlManufacturers_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var manufacturer = e.Item.DataItem as Manufacturer; var hlLink = e.Item.FindControl("hlLink") as HyperLink; if (hlLink != null) { hlLink.NavigateUrl = SEOHelper.GetManufacturerUrl(manufacturer); hlLink.Text = Server.HtmlEncode(manufacturer.LocalizedName); } } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (NopContext.Current.User == null || NopContext.Current.User.IsGuest) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } string title = GetLocaleResourceString("PageTitle.Account"); SEOHelper.RenderTitle(this, title, true); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); } Forum forum = ForumManager.GetForumByID(this.ForumID); if (forum != null) { string title = forum.Name; SEOHelper.RenderTitle(this, title, true); } }
protected void Page_Load(object sender, EventArgs e) { // ~~ Response.Redirect("~/checkoutshippingmethod.aspx"); if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !CustomerManager.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (this.Cart.Count == 0) { Response.Redirect("~/shoppingcart.aspx"); } }
protected void dlRecentProduct_Bound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { lwg_Catalog obj = (lwg_Catalog)e.Item.DataItem; string catalogURL = SEOHelper.GetCatalogUrl(obj); Label lbl = (Label)e.Item.FindControl("lblNumber"); lbl.Text = (e.Item.ItemIndex + 1).ToString(); HyperLink hpl = (HyperLink)e.Item.FindControl("hplName"); hpl.Text = obj.TitleDisplay; hpl.NavigateUrl = catalogURL; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); } ForumTopic forumTopic = ForumManager.GetTopicByID(this.TopicID); if (forumTopic != null) { string title = forumTopic.Subject; SEOHelper.RenderTitle(this, title, true); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureSSL(); } Response.CacheControl = "private"; Response.Expires = 0; Response.AddHeader("pragma", "no-cache"); string title = GetLocaleResourceString("PageTitle.CheckoutCompleted"); SEOHelper.RenderTitle(this, title, true); }
protected void Page_Load(object sender, EventArgs e) { if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !this.CustomerService.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (Cart.Count == 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } //validation var scWarnings = this.ShoppingCartService.GetShoppingCartWarnings(Cart, NopContext.Current.User.CheckoutAttributes, true); if (scWarnings.Count > 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } else { foreach (ShoppingCartItem sci in this.Cart) { List <String> sciWarnings = this.ShoppingCartService.GetShoppingCartItemWarnings( sci.ShoppingCartType, sci.ProductVariantId, sci.AttributesXml, sci.CustomerEnteredPrice, sci.Quantity); if (sciWarnings.Count > 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } } } if (!Page.IsPostBack) { if (!this.ShippingService.ShoppingCartRequiresShipping(Cart)) { pnlShippingAddress.Visible = false; pnlShippingMethods.Visible = false; } SelectPane(CheckoutStepEnum.ShippingAddress); } }
protected void rptrTopics_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ForumTopic forumTopic = e.Item.DataItem as ForumTopic; Customer customer = forumTopic.User; HyperLink hlTopic = e.Item.FindControl("hlTopic") as HyperLink; if (hlTopic != null) { hlTopic.NavigateUrl = SEOHelper.GetForumTopicURL(forumTopic.ForumTopicID); hlTopic.Text = Server.HtmlEncode(forumTopic.Subject); } HyperLink hlTopicStarter = e.Item.FindControl("hlTopicStarter") as HyperLink; if (hlTopicStarter != null) { if (CustomerManager.AllowViewingProfiles) { if (customer != null) { hlTopicStarter.Text = Server.HtmlEncode(CustomerManager.FormatUserName(customer)); hlTopicStarter.NavigateUrl = SEOHelper.GetUserProfileURL(customer.CustomerID); } } else { hlTopicStarter.Visible = false; } } Label lblTopicStarter = e.Item.FindControl("lblTopicStarter") as Label; if (lblTopicStarter != null) { if (!CustomerManager.AllowViewingProfiles) { if (customer != null) { lblTopicStarter.Text = Server.HtmlEncode(CustomerManager.FormatUserName(customer)); } } else { lblTopicStarter.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); } if (!ProductManager.RecentlyAddedProductsEnabled) { Response.Redirect(CommonHelper.GetStoreLocation()); } string title = GetLocaleResourceString("PageTitle.RecentlyAddedProducts"); SEOHelper.RenderTitle(this, title, true); }
protected void lvRecentlyViewedProducts_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { var dataItem = e.Item as ListViewDataItem; if (dataItem != null) { var product = dataItem.DataItem as Product; if (product != null) { var hlProduct = dataItem.FindControl("hlProduct") as HyperLink; hlProduct.NavigateUrl = SEOHelper.GetProductUrl(product); } } } }
protected void btnReply_Click(object sender, EventArgs e) { ForumTopic forumTopic = ForumManager.GetTopicByID(this.TopicID); if (forumTopic != null) { if (!ForumManager.IsUserAllowedToCreatePost(NopContext.Current.User, forumTopic)) { string loginURL = CommonHelper.GetLoginPageURL(true); Response.Redirect(loginURL); } string newForumPostURL = SEOHelper.GetNewForumPostURL(forumTopic.ForumTopicID); Response.Redirect(newForumPostURL); } }