protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["pri"])) { var oProjectCategory = new ProjectCategory(); var dv = oProjectCategory.ProjectCategorySelectOne(Request.QueryString["pri"]).DefaultView; if (dv != null && dv.Count <= 0) { return; } var row = dv[0]; strTitle = Server.HtmlDecode(row["ProjectCategoryName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTitle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); //hdnDesign.Value = progressTitle(dv[0]["ProductCategoryName"].ToString()) + "-dci-" + dv[0]["ProductCategoryID"].ToString() + ".aspx"; Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); //lblTitle.Text = strTitle; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTitle, strDescription, strMetaTitle, strMetaDescription; var oProjectCategory = new ProjectCategory(); var dv = oProjectCategory.ProjectCategorySelectOne(Request.QueryString["bg"]).DefaultView; if (dv != null && dv.Count <= 0) { return; } var row = dv[0]; strTitle = Server.HtmlDecode(row["ProjectCategoryNameEn"].ToString()); strDescription = Server.HtmlDecode(row["DescriptionEn"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTitleEn"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescriptionEn"].ToString()); Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (((DataView)odsHoiBacSi.Select()).Count <= DataPager1.PageSize) { DataPager1.Visible = false; } string strTitle, strDescription, strMetaTitle, strMetaDescription; if (!string.IsNullOrEmpty(Request.QueryString["nci"])) { var oProjectCategory = new ProjectCategory(); var dv = oProjectCategory.ProjectCategorySelectOne(Request.QueryString["nci"]).DefaultView; if (dv != null && dv.Count <= 0) { return; } var row = dv[0]; strTitle = Server.HtmlDecode(row["ProjectCategoryName"].ToString()); strDescription = Server.HtmlDecode(row["Description"].ToString()); strMetaTitle = Server.HtmlDecode(row["MetaTitle"].ToString()); strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString()); //hdnSanPhamDetails.Value = progressTitle(dv2[0]["ProductCategoryName"].ToString()) + "-pci-" + dv2[0]["ProductCategoryID"].ToString() + ".aspx"; } else { strTitle = strMetaTitle = "Tin Tức"; strDescription = "Tin Tức"; strMetaDescription = "Tin Tức"; } Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle; var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription }; Header.Controls.Add(meta); //lblTitle.Text = strTitle; } }