protected void Page_Load(object sender, EventArgs e) { if (category == null || category.Deleted || !category.Published) { Response.Redirect(CommonHelper.GetStoreLocation()); } //title, meta string title = string.Empty; if (!string.IsNullOrEmpty(category.LocalizedMetaTitle)) { title = category.LocalizedMetaTitle; } else { title = category.LocalizedName; } SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", category.LocalizedMetaDescription, true); SEOHelper.RenderMetaTag(this, "keywords", category.LocalizedMetaKeywords, true); //canonical URL if (SEOHelper.EnableUrlRewriting && this.SettingManager.GetSettingValueBoolean("SEO.CanonicalURLs.Category.Enabled")) { if (!this.SEName.Equals(SEOHelper.GetCategorySEName(category))) { string canonicalUrl = SEOHelper.GetCategoryUrl(category); if (this.Request.QueryString != null) { for (int i = 0; i < this.Request.QueryString.Count; i++) { string key = Request.QueryString.GetKey(i); if (!String.IsNullOrEmpty(key) && (key.ToLowerInvariant() != "categoryid") && (key.ToLowerInvariant() != "sename")) { canonicalUrl = CommonHelper.ModifyQueryString(canonicalUrl, key + "=" + Request.QueryString[i], null); } } } SEOHelper.RenderCanonicalTag(Page, canonicalUrl); } } if (!Page.IsPostBack) { NopContext.Current.LastContinueShoppingPage = CommonHelper.GetThisPageUrl(true); } }