private CateNewsGroup CateNewsGroupReader(SqlDataReader reader) { CateNewsGroup cateNewsGroup = new CateNewsGroup(); cateNewsGroup.CateNewsGroupID = (int)reader["CateNewsGroupID"]; cateNewsGroup.GroupCate = (int)reader["GroupCate"]; cateNewsGroup.CateNewsGroupName = (string)reader["CateNewsGroupName"]; cateNewsGroup.ShortName = (string)reader["ShortName"]; cateNewsGroup.Description = (string)reader["Description"]; cateNewsGroup.Order = (int)reader["Order"]; cateNewsGroup.IsView = (bool)reader["IsView"]; cateNewsGroup.IsHome = (bool)reader["IsHome"]; cateNewsGroup.IsMenu = (bool)reader["IsMenu"]; cateNewsGroup.IsNew = (bool)reader["IsNew"]; cateNewsGroup.IsPage = (bool)reader["IsPage"]; cateNewsGroup.IsRegister = (bool)reader["IsRegister"]; cateNewsGroup.IsFaq = (bool)reader["IsFaq"]; cateNewsGroup.IsUrl = (bool)reader["IsUrl"]; cateNewsGroup.Url = (string)reader["Url"]; cateNewsGroup.Icon = (string)reader["Icon"]; cateNewsGroup.Position = (int)reader["Position"]; cateNewsGroup.Menu = (int)reader["Menu"]; cateNewsGroup.IsOfficial = (bool)reader["IsOfficial"]; cateNewsGroup.Language = (string)reader["Language"]; cateNewsGroup.PageLayoutID = (int)reader["PageLayoutID"]; return(cateNewsGroup); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int groupcate = 0; if (!String.IsNullOrEmpty(hddValue.Value)) { if (int.TryParse(hddValue.Value.Replace(",", ""), out groupcate)) { ViewNewsHot(groupcate); if (AspNetCache.CheckCache("HTML_ltlTitle_mainhome_news_by_group_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false) { CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsGroup cateNewGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate, Language.language); string strTitle = ""; if (cateNewGroup != null) { strTitle = "<a href='" + ResolveUrl("~/") + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewGroup.CateNewsGroupID) + "/" + GetString(cateNewGroup.CateNewsGroupName) + "-" + groupcate + ".aspx' title='" + cateNewGroup.CateNewsGroupName + "'>" + cateNewGroup.CateNewsGroupName + "</a>"; } AspNetCache.SetCacheWithTime("HTML_ltlTitle_mainhome_news_by_group_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), strTitle, 150); ltlTitle.Text = strTitle; } else { ltlTitle.Text = (string)AspNetCache.GetCache("HTML_ltlTitle_mainhome_news_by_group_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_")); } } } } }
public CateNewsGroup GetCateNewsGroupByGroupCate(int groupcate, string _lang) { CateNewsGroup cateNewsGroup = null; using (SqlConnection connection = GetConnection()) { SqlCommand command = new SqlCommand("_CateNewsGroupGetByGroupCate", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@GroupCate", groupcate); command.Parameters.AddWithValue("@Language", _lang); connection.Open(); using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection)) { if (reader.Read()) { cateNewsGroup = CateNewsGroupReader(reader); } else { //throw new DataAccessException("Khong tim thay gia tri nao");' cateNewsGroup = null; } command.Dispose(); } } return(cateNewsGroup); }
private string GetSubCategoryMenuCateGroup(string strMenuSub, int iCate, string lang, int group) { CateNewsBSO catenewsBSO = new CateNewsBSO(); DataTable datatable = catenewsBSO.getCateClientGroupUrl(iCate, lang, group, true); CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsGroup catenewsgroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(group, lang); if (datatable.Rows.Count > 0) { strMenuSub += "<ul>"; foreach (DataRow dataRow in datatable.Rows) { strMenuSub += "<li>"; if (Convert.ToBoolean(dataRow["isUrl"].ToString())) { strMenuSub += "<a href='" + dataRow["Url"].ToString() + "'>" + dataRow["CateNewsName"].ToString() + "</a>"; } //else if (catenewsgroup.IsPage) // strMenuSub += "<a href='" + ResolveUrl("~/") + "tin-tuc-dmp/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["CateNewsName"].ToString() + "</a>"; else { strMenuSub += "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"].ToString())) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["CateNewsName"].ToString() + "</a>"; } strMenuSub += GetSubCategoryMenuCateGroup("", Convert.ToInt32(dataRow["CateNewsID"].ToString()), lang, group); strMenuSub += "</li>"; } strMenuSub += "</ul>"; } return(strMenuSub); }
private CateNewsGroup ReceiveHtml() { CateNewsGroup catenewsGroup = new CateNewsGroup(); catenewsGroup.CateNewsGroupID = (hddCateNewsGroupID.Value != "") ? Convert.ToInt32(hddCateNewsGroupID.Value) : 0; catenewsGroup.CateNewsGroupName = txtCateNewsGroupName.Text; catenewsGroup.ShortName = txtShortName.Text; catenewsGroup.GroupCate = (txtGroupCate.Text != "") ? Convert.ToInt32(txtGroupCate.Text) : 0; catenewsGroup.Order = (hddOrder.Value != "") ? Convert.ToInt32(hddOrder.Value) : 0; catenewsGroup.Description = txtDescription.Text; catenewsGroup.IsView = chkView.Checked; catenewsGroup.IsHome = chkHome.Checked; catenewsGroup.IsMenu = chkMenu.Checked; catenewsGroup.IsNew = chkNews.Checked; catenewsGroup.IsPage = chkPage.Checked; catenewsGroup.IsRegister = chkRegister.Checked; catenewsGroup.IsFaq = chkFaq.Checked; catenewsGroup.IsOfficial = chkOfficial.Checked; catenewsGroup.Menu = (txtMenu.Text != "") ? Convert.ToInt32(txtMenu.Text) : 0; catenewsGroup.Icon = (txtimage4_3.Text != "") ? txtimage4_3.Text : hddIcon.Value; catenewsGroup.IsUrl = rdbUrl.Checked; catenewsGroup.Url = txtUrl.Text; catenewsGroup.Position = (txtPosition.Text != "") ? Convert.ToInt32(txtPosition.Text) : 0; catenewsGroup.Language = Language.language; catenewsGroup.PageLayoutID = Convert.ToInt32(ddlPageLayout.SelectedValue); return(catenewsGroup); }
protected void grvCateNewsGroup_RowCommand(object sender, GridViewCommandEventArgs e) { int Id = Convert.ToInt32(e.CommandArgument.ToString()); CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO(); CateNewsGroup _catenewgroup = catenewsGroupBSO.GetCateNewsGroupById(Id); string nName = e.CommandName.ToLower(); switch (nName) { case "rules": Response.Redirect("~/Admin/editcatenewsgrouproles/" + Id + "/Default.aspx"); break; case "_edit": Response.Redirect("~/Admin/editcatenewsgroup/" + Id + "/Default.aspx"); break; case "_listcate": Response.Redirect("~/Admin/Group/listcatenews/" + _catenewgroup.GroupCate + "/Default.aspx"); break; case "_delete": catenewsGroupBSO.DeleteCateNewsGroup(Id); ViewCateGroup(); AspNetCache.Reset(); break; } }
private string BindMenuCateGroup(string strMenuSub, int iCate, string lang, int group, int cId, string keyword) { CateNewsBSO catenewsBSO = new CateNewsBSO(); DataTable table = catenewsBSO.getCateClientGroupUrl(iCate, lang, group, true); CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsGroup catenewsgroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(group, lang); if (catenewsgroup != null) { if (table.Rows.Count > 0) { strMenuSub += "<ul class='list-inline tags-v2 margin-bottom-20'>"; foreach (DataRow dataRow in table.Rows) { strMenuSub += "<li>"; if (!Convert.ToBoolean(dataRow["isUrl"].ToString())) { if (!String.IsNullOrEmpty(keyword) && keyword.Trim() != "" && keyword.Trim() != "search") { strMenuSub += "<a href='" + ResolveUrl("~/") + "tim-kiem/" + dataRow["GroupCate"] + "/" + dataRow["CateNewsID"].ToString() + "/" + GetString(keyword) + ".aspx'>" + dataRow["CateNewsName"].ToString() + "</a>"; } else { strMenuSub += "<a href='" + ResolveUrl("~/") + "tim-kiem/" + dataRow["GroupCate"] + "/" + dataRow["CateNewsID"].ToString() + "/search.aspx'>" + dataRow["CateNewsName"].ToString() + "</a>"; } } strMenuSub += "</li>"; //strMenuSub += GetSubCategoryMenuCateGroup("", Convert.ToInt32(dataRow["CateNewsID"].ToString()), lang, group); } strMenuSub += "</ul>"; } } return(strMenuSub); }
protected void btn_edit_Click(object sender, EventArgs e) { try { CateNewsGroup catenewsGroup = ReceiveHtml(); CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO(); catenewsGroupBSO.UpdateCateNewsGroup(catenewsGroup); clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>"; initControl(catenewsGroup.CateNewsGroupID); AspNetCache.Reset(); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } }
private string BindMenuCateGroup(string strMenuSub, int iCate, string lang, int group) { CateNewsBSO catenewsBSO = new CateNewsBSO(); DataTable table = catenewsBSO.getCateClientGroupUrl(iCate, lang, group, true); CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsGroup catenewsgroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(group, lang); if (catenewsgroup != null) { if (table.Rows.Count > 0) { strMenuSub += "<ul class='dropdown-menu'>"; foreach (DataRow dataRow in table.Rows) { DataTable tblSub = catenewsBSO.getCateClientGroupUrl(Convert.ToInt32(dataRow["CateNewsID"].ToString()), lang, group, true); if (tblSub.Rows.Count > 0) { strMenuSub += "<li class='dropdown-submenu'>"; } else { strMenuSub += "<li>"; } //strMenuSub += "<li class='dropdown-submenu'>"; if (Convert.ToBoolean(dataRow["isUrl"].ToString())) { strMenuSub += "<a href='" + dataRow["Url"].ToString() + "'>" + dataRow["CateNewsName"].ToString() + "</a>"; } else { strMenuSub += "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["CateNewsName"].ToString() + "</a>"; } strMenuSub += GetSubCategoryMenuCateGroup("", Convert.ToInt32(dataRow["CateNewsID"].ToString()), lang, group); strMenuSub += "</li>"; } strMenuSub += "</ul>"; } } return(strMenuSub); }
protected void btn_add_Click(object sender, EventArgs e) { try { CateNewsGroup catenewsGroup = ReceiveHtml(); CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO(); int id = catenewsGroupBSO.CreateCateNewsGroup(catenewsGroup); if (!Session["Admin_UserName"].ToString().Equals("administrator")) { AdminRolesBSO adminRolesBSO = new AdminRolesBSO(); DataTable table = adminRolesBSO.GetAdminRolesByUserName(Session["Admin_UserName"].ToString()); CateNewsGroupPermissionBSO catenewGroupPermissionBSO = new CateNewsGroupPermissionBSO(); CateNewsGroupPermission cateNewsGroupPermission = new CateNewsGroupPermission(); if (table.Rows.Count > 0) { foreach (DataRow subrow in table.Rows) { cateNewsGroupPermission.CateNewsGroupID = id; cateNewsGroupPermission.RolesID = Convert.ToInt32(subrow["RolesID"].ToString()); cateNewsGroupPermission.Permission = ""; cateNewsGroupPermission.UserName = Session["Admin_UserName"].ToString(); cateNewsGroupPermission.Created = DateTime.Now; cateNewsGroupPermission.Language = Language.language; catenewGroupPermissionBSO.CreateCateNewsGroupPermission(cateNewsGroupPermission); } } } clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>"; initControl(id); AspNetCache.Reset(); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } }
public int CreateCateNewsGroup(CateNewsGroup cateNewsGroup) { using (SqlConnection connection = GetConnection()) { SqlCommand command = new SqlCommand("_CateNewsGroupInsert", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@CateNewsGroupID", 0); command.Parameters.AddWithValue("@GroupCate", cateNewsGroup.GroupCate); command.Parameters.AddWithValue("@CateNewsGroupName", cateNewsGroup.CateNewsGroupName); command.Parameters.AddWithValue("@ShortName", cateNewsGroup.ShortName); command.Parameters.AddWithValue("@Description", cateNewsGroup.Description); command.Parameters.AddWithValue("@Order", cateNewsGroup.Order); command.Parameters.AddWithValue("@IsView", cateNewsGroup.IsView); command.Parameters.AddWithValue("@IsHome", cateNewsGroup.IsHome); command.Parameters.AddWithValue("@IsMenu", cateNewsGroup.IsMenu); command.Parameters.AddWithValue("@IsNew", cateNewsGroup.IsNew); command.Parameters.AddWithValue("@IsPage", cateNewsGroup.IsPage); command.Parameters.AddWithValue("@IsRegister", cateNewsGroup.IsRegister); command.Parameters.AddWithValue("@IsFaq", cateNewsGroup.IsFaq); command.Parameters.AddWithValue("@IsUrl", cateNewsGroup.IsUrl); command.Parameters.AddWithValue("@Url", cateNewsGroup.Url); command.Parameters.AddWithValue("@Icon", cateNewsGroup.Icon); command.Parameters.AddWithValue("@Position", cateNewsGroup.Position); command.Parameters.AddWithValue("@Menu", cateNewsGroup.Menu); command.Parameters.AddWithValue("@IsOfficial", cateNewsGroup.IsOfficial); command.Parameters.AddWithValue("@Language", cateNewsGroup.Language); command.Parameters.AddWithValue("@PageLayoutID", cateNewsGroup.PageLayoutID); SqlParameter sp = new SqlParameter("@pReturnValue", SqlDbType.Int); sp.Direction = ParameterDirection.Output; command.Parameters.Add(sp); connection.Open(); command.ExecuteNonQuery(); int id = Convert.ToInt32(sp.Value.ToString()); return(id); } }
public void UpdateCateNewsGroup(CateNewsGroup cateNewsGroup) { using (SqlConnection connection = GetConnection()) { SqlCommand command = new SqlCommand("_CateNewsGroupUpdate", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Type", 1); command.Parameters.AddWithValue("@CateNewsGroupID", cateNewsGroup.CateNewsGroupID); command.Parameters.AddWithValue("@GroupCate", cateNewsGroup.GroupCate); command.Parameters.AddWithValue("@CateNewsGroupName", cateNewsGroup.CateNewsGroupName); command.Parameters.AddWithValue("@ShortName", cateNewsGroup.ShortName); command.Parameters.AddWithValue("@Description", cateNewsGroup.Description); command.Parameters.AddWithValue("@Order", cateNewsGroup.Order); command.Parameters.AddWithValue("@IsView", cateNewsGroup.IsView); command.Parameters.AddWithValue("@IsHome", cateNewsGroup.IsHome); command.Parameters.AddWithValue("@IsMenu", cateNewsGroup.IsMenu); command.Parameters.AddWithValue("@IsNew", cateNewsGroup.IsNew); command.Parameters.AddWithValue("@IsPage", cateNewsGroup.IsPage); command.Parameters.AddWithValue("@IsRegister", cateNewsGroup.IsRegister); command.Parameters.AddWithValue("@IsFaq", cateNewsGroup.IsFaq); command.Parameters.AddWithValue("@IsUrl", cateNewsGroup.IsUrl); command.Parameters.AddWithValue("@Url", cateNewsGroup.Url); command.Parameters.AddWithValue("@Icon", cateNewsGroup.Icon); command.Parameters.AddWithValue("@Position", cateNewsGroup.Position); command.Parameters.AddWithValue("@Menu", cateNewsGroup.Menu); command.Parameters.AddWithValue("@IsOfficial", cateNewsGroup.IsOfficial); command.Parameters.AddWithValue("@Language", cateNewsGroup.Language); command.Parameters.AddWithValue("@PageLayoutID", cateNewsGroup.PageLayoutID); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Khong cap nhat duoc quang cao"); } else { command.Dispose(); } } }
protected void Page_Load(object sender, EventArgs e) { int Id = 0; if (!string.IsNullOrEmpty(Request["Id"])) { int.TryParse(Request["Id"].Replace(",", ""), out Id); } if (!string.IsNullOrEmpty(Request["dll"])) { NavigationTitle(Request["dll"]); } hddCateNewsGroupID.Value = Convert.ToString(Id); if (!IsPostBack) { CateNewsGroupBSO _catenewGroupBSO = new CateNewsGroupBSO(); CateNewsGroup _catenewGroups = _catenewGroupBSO.GetCateNewsGroupById(Id); HddGroupCate.Value = Convert.ToString(_catenewGroups.GroupCate); ltlTitle.Text = _catenewGroups.CateNewsGroupName; initControl(Id); } }
private string BindMenu(string strMenuSub, int groupcate, int cID) { //if (AdminName.Equals("administrator")) //{ // SQL = "SELECT * FROM tblModules Where [IsMenu] =1 And [Modules_Parent] = " + iCate + " Order by [Modules_Order] ASC"; // table = common.CreateDataView(SQL); //} //else //{ // SQL = "SELECT * FROM tblModules Where [IsMenu] =1 And [Modules_Parent] = " + iCate + " And Modules_Url in ('" + strModules + "') Order by [Modules_Order] ASC"; // table = common.CreateDataView(SQL); //} DataTable table = new DataTable(); CateNewsBSO catenewsBSO = new CateNewsBSO(); table = catenewsBSO.getCateClientGroupUrl(0, Language.language, groupcate, true); CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsGroup catenewsgroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate, Language.language); if (catenewsgroup != null) { if (table.Rows.Count > 0) { strMenuSub += "<ul>"; foreach (DataRow dataRow in table.Rows) { strMenuSub += "<li>"; //strMenuSub += "<a href='" + ResolveUrl("~/") + "Admin/" + dataRow["Modules_Url"] + "/Default.aspx'>" + dataRow["Modules_Name"].ToString() + "</a>"; if (checkActive(cID, Convert.ToInt32(dataRow["CateNewsID"].ToString()))) { if (Convert.ToBoolean(dataRow["isUrl"].ToString())) { strMenuSub += "<a href='" + dataRow["Url"].ToString() + "'>" + dataRow["ShortName"].ToString() + "</a>"; } else { strMenuSub += "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["ShortName"].ToString() + "</a>"; } //strMenuSub += "<a href='" + ResolveUrl("~/") + "Admin/" + dataRow["Modules_Url"] + "/Default.aspx'>" + dataRow["Modules_Name"].ToString() + "</a>"; strMenuSub += "<span class='closed opened'></span>"; strMenuSub += "<div style='display: block;'>"; } else { if (Convert.ToBoolean(dataRow["isUrl"].ToString())) { strMenuSub += "<a href='" + dataRow["Url"].ToString() + "'>" + dataRow["ShortName"].ToString() + "</a>"; } else { strMenuSub += "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["ShortName"].ToString() + "</a>"; } //strMenuSub += "<a href='" + ResolveUrl("~/") + "Admin/" + dataRow["Modules_Url"] + "/Default.aspx'>" + dataRow["Modules_Name"].ToString() + "</a>"; strMenuSub += "<span class='closed'></span>"; strMenuSub += "<div style='display: none;'>"; } strMenuSub += GetSubMenu("", Convert.ToInt32(dataRow["CateNewsID"].ToString()), groupcate, cID); strMenuSub += "</div>"; strMenuSub += "</li>"; } strMenuSub += "</ul>"; } } return(strMenuSub); }
protected void Page_Load(object sender, EventArgs e) { int cId = 0; if (!String.IsNullOrEmpty(Request["cid"])) { int.TryParse(Request["cid"], out cId); } int gId = 0; if (!String.IsNullOrEmpty(Request["g"])) { int.TryParse(Request["g"], out gId); } hddGroupCate.Value = Convert.ToString(gId); hddCateID.Value = Convert.ToString(cId); if (!IsPostBack) { CateNewsGroupBSO cateNewsGroupBso = new CateNewsGroupBSO(); CateNewsBSO cateNewsBso = new CateNewsBSO(); CateNews cateNewsById = cateNewsBso.GetCateNewsById(cId); CateNewsGroup groupByGroupCate = cateNewsGroupBso.GetCateNewsGroupByGroupCate(gId, Language.language); if (groupByGroupCate != null && cateNewsById != null) { //GetHotNewsGroup(cId, gId); ViewListCate(cId, gId); title_name.Text = cateNewsById.CateNewsName; string cate = "<a href='" + ResolveUrl("~/") + "c2/" + cateNewsGroupBso.GetSlugById(groupByGroupCate.CateNewsGroupID) + "/" + GetString(groupByGroupCate.CateNewsGroupName) + "-" + cateNewsById.GroupCate + ".aspx' class='content_Text_Cat' title='" + groupByGroupCate.CateNewsGroupName + "'>"; string s1 = ""; while (cateNewsById.ParentNewsID != 0) { int parentNewsId = cateNewsById.ParentNewsID; cateNewsById = cateNewsBso.GetCateNewsById(parentNewsId); s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' ><a href='" + ResolveUrl("~/") + "c3/" + cateNewsBso.GetSlugByCateId(cateNewsById.CateNewsID) + "/" + GetString(cateNewsById.CateNewsName) + "-" + cateNewsById.GroupCate + "-" + cateNewsById.CateNewsID + ".aspx' class='content_Text_Cat' title='" + cateNewsById.CateNewsName + "'>" + cateNewsById.CateNewsName + "</a>" + s1; } cate += groupByGroupCate.CateNewsGroupName.ToString() + "</a> " + s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.T_home + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >"; title_cate.Text += cate; Page.Title = cateNewsById.CateNewsName; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = cateNewsById.CateNewsName; Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = GetString(cateNewsById.CateNewsName); Page.Header.Controls.Add(_keyWords); } else if (cId == 0) { if (groupByGroupCate != null) { //GetHotNewsGroup(cId, gId); ViewListCate(cId, gId); //title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>TRANG CHỦ</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_name.Text = groupByGroupCate.CateNewsGroupName; Page.Title = title_name.Text; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = title_name.Text; Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = GetString(title_name.Text); Page.Header.Controls.Add(_keyWords); } } } }
public int CreateCateNewsGroup(CateNewsGroup cateNewsGroup) { CateNewsGroupDAO cateNewsGroupDAO = new CateNewsGroupDAO(); return(cateNewsGroupDAO.CreateCateNewsGroup(cateNewsGroup)); }
public void UpdateCateNewsGroup(CateNewsGroup cateNewsGroup) { CateNewsGroupDAO cateNewsGroupDAO = new CateNewsGroupDAO(); cateNewsGroupDAO.UpdateCateNewsGroup(cateNewsGroup); }
private string BindMenuVer(string strMenuSub, int groupcate, int cID) { DataTable table = new DataTable(); CateNewsBSO catenewsBSO = new CateNewsBSO(); table = catenewsBSO.getCateClientGroupUrl(cID, Language.language, groupcate, true); CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsGroup catenewsgroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(groupcate, Language.language); if (catenewsgroup != null) { if (table.Rows.Count > 0) { // int level = 1; strMenuSub += "<ul class='nav nav-stacke'>"; foreach (DataRow dataRow in table.Rows) { // strMenuSub += "<li>"; //strMenuSub += "<a href='" + ResolveUrl("~/") + "Admin/" + dataRow["Modules_Url"] + "/Default.aspx'>" + dataRow["Modules_Name"].ToString() + "</a>"; if (checkActive(cID, Convert.ToInt32(dataRow["CateNewsID"].ToString()))) { strMenuSub += "<li class='active'>"; if (Convert.ToBoolean(dataRow["isUrl"].ToString())) { strMenuSub += "<a href='" + dataRow["Url"].ToString() + "'>" + dataRow["ShortName"].ToString() + "</a>"; } else { strMenuSub += "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["ShortName"].ToString() + "</a>"; } strMenuSub += "</li>"; } else { strMenuSub += "<li>"; if (Convert.ToBoolean(dataRow["isUrl"].ToString())) { strMenuSub += "<a href='" + dataRow["Url"].ToString() + "'>" + dataRow["ShortName"].ToString() + "</a>"; } else { strMenuSub += "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx'>" + dataRow["ShortName"].ToString() + "</a>"; } //strMenuSub += "<a href='" + ResolveUrl("~/") + "Admin/" + dataRow["Modules_Url"] + "/Default.aspx'>" + dataRow["Modules_Name"].ToString() + "</a>"; strMenuSub += "</li>"; } // strMenuSub += GetSubMenu("", Convert.ToInt32(dataRow["CateNewsID"].ToString()), groupcate, cID, level + 1); //strMenuSub += "</div>"; //strMenuSub += "</li>"; } strMenuSub += "</ul>"; } } return(strMenuSub); }
private void initControl(int Id) { if (Id > 0) { btn_add.Visible = false; btn_edit.Visible = true; btn_add1.Visible = false; btn_add2.Visible = false; btn_edit1.Visible = true; try { CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO(); CateNewsGroup catenewsGroup = catenewsGroupBSO.GetCateNewsGroupById(Id); hddCateNewsGroupID.Value = Convert.ToString(catenewsGroup.CateNewsGroupID); txtCateNewsGroupName.Text = catenewsGroup.CateNewsGroupName; txtShortName.Text = catenewsGroup.ShortName; txtGroupCate.Text = catenewsGroup.GroupCate.ToString(); txtDescription.Text = catenewsGroup.Description; hddOrder.Value = Convert.ToString(catenewsGroup.Order); txtMenu.Text = Convert.ToString(catenewsGroup.Menu); chkView.Checked = catenewsGroup.IsView; chkHome.Checked = catenewsGroup.IsHome; chkMenu.Checked = catenewsGroup.IsMenu; chkNews.Checked = catenewsGroup.IsNew; chkPage.Checked = catenewsGroup.IsPage; chkRegister.Checked = catenewsGroup.IsRegister; chkFaq.Checked = catenewsGroup.IsFaq; chkOfficial.Checked = catenewsGroup.IsOfficial; hddIcon.Value = catenewsGroup.Icon; txtimage4_3.Text = catenewsGroup.Icon; if (catenewsGroup.Icon != "") { img_thumb.Text = "<img src='" + catenewsGroup.Icon + "' width='48px'>"; } rdbUrl.Checked = catenewsGroup.IsUrl; txtUrl.Text = catenewsGroup.Url; txtPosition.Text = Convert.ToString(catenewsGroup.Position); if (catenewsGroup.IsUrl == true) { txtUrl.Visible = true; panelFilename.Visible = true; } else { txtUrl.Visible = false; panelFilename.Visible = false; } Bind_ddlPageLayout(); ddlPageLayout.SelectedValue = Convert.ToString(catenewsGroup.PageLayoutID); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } } else { Bind_ddlPageLayout(); ddlPageLayout.SelectedIndex = 0; btn_edit.Visible = false; btn_add.Visible = true; btn_edit1.Visible = false; btn_add1.Visible = true; btn_add2.Visible = true; rdbUrl.Checked = false; panelFilename.Visible = false; } }
public static void GetNavigation(string strSlugPage, string g, string cId, string Id, string urlRoot) { if (strSlugPage != string.Empty) { SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); SYS_PageLayout _pageLayout = new SYS_PageLayout(); if (!AspNetCache.CheckCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_"))) { _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug(strSlugPage, Language.language); if (_pageLayout == null) { _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug("home", Language.language); } AspNetCache.SetCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_"), _pageLayout); } else { _pageLayout = (SYS_PageLayout)AspNetCache.GetCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_")); } Navigation.TitleName = _pageLayout.PageName; Navigation.TitleCate = "<li><a href='" + urlRoot + "'>Trang chủ</a></li>"; CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); NewsGroupBSO newsgroupBSO = new NewsGroupBSO(); CateNewsBSO catenewsBSO = new CateNewsBSO(); if (strSlugPage == "du-an") { if (!String.IsNullOrEmpty(Id)) { Navigation.TitleName = "Thông tin dự án"; string cate = "<li><a href='" + urlRoot + "c2/du-an-c/du-an-1.aspx'>Dự án"; cate += "</a></li>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else if (strSlugPage == "detailvideos") { if (!String.IsNullOrEmpty(cId)) { VideosCateBSO videosCateBSO = new VideosCateBSO(); VideosCate videoCate = videosCateBSO.GetVideosCateById(Convert.ToInt32(cId)); Navigation.TitleName = "<a href='" + urlRoot + "thu-vien-video" + "-" + videoCate.VideosCateID + ".aspx'>" + videoCate.VideosCateName + "</a>"; string cate = "<li><a href='" + urlRoot + "thu-vien-video.aspx'>Thư viện Video"; string s1 = ""; while (videoCate.ParentCateID != 0) { int pId = videoCate.ParentCateID; videoCate = videosCateBSO.GetVideosCateById(pId); s1 = "<li><a href='" + urlRoot + "thu-vien-video/" + videoCate.VideosCateName + "-" + videoCate.VideosCateID + ".aspx'>" + videoCate.VideosCateName + "</a></li>" + s1; } // cate += "Video"; //Sửa lại cate += "</a></li>"; cate += s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else if (strSlugPage == "detailalbums") { if (!String.IsNullOrEmpty(cId)) { AlbumsCateBSO albumsCateBSO = new AlbumsCateBSO(); AlbumsCate videoCate = albumsCateBSO.GetAlbumsCateById(Convert.ToInt32(cId)); Navigation.TitleName = "<a href='" + urlRoot + "thu-vien-video" + "-" + videoCate.AlbumsCateID + ".aspx'>" + videoCate.AlbumsCateName + "</a>"; string cate = "<li><a href='" + urlRoot + "thu-vien-video.aspx'>Thư viện Video"; string s1 = ""; while (videoCate.ParentCateID != 0) { int pId = videoCate.ParentCateID; videoCate = albumsCateBSO.GetAlbumsCateById(pId); s1 = "<li><a href='" + urlRoot + "thu-vien-video/" + videoCate.AlbumsCateName + "-" + videoCate.AlbumsCateID + ".aspx'>" + videoCate.AlbumsCateName + "</a></li>" + s1; } // cate += "Video"; //Sửa lại cate += "</a></li>"; cate += s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else if (strSlugPage == "dh") { if (!String.IsNullOrEmpty(g)) { Navigation.TitleName = "<a href='" + urlRoot + "tim-truong/0-0-0-0-0-0-0/search.aspx'>Thông tin trường</a>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; } } else if (strSlugPage == "dang-ky-ts") { if (!String.IsNullOrEmpty(g)) { Navigation.TitleName = "<a href='" + urlRoot + "c2/dh-dk/Dang-ky-tuyen-sinh-truc-tuyen-20.aspx'>Trang Đăng ký tuyển sinh</a>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; } } else if (strSlugPage == "dh-dk") { if (!String.IsNullOrEmpty(g)) { Navigation.TitleName = "<a href='" + urlRoot + "c2/dh-dk/Dang-ky-tuyen-sinh-truc-tuyen-20.aspx'>Trang Đăng ký tuyển sinh</a>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; } } else if (!String.IsNullOrEmpty(Id)) { NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Convert.ToInt32(Id)); if (newsgroup != null && newsgroup.CateNewsID > 0) { CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID); CateNewsGroup cateNewsGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate, Language.language); Navigation.TitleName = "<a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a>"; string cate = "<li><a href='" + urlRoot + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewsGroup.CateNewsGroupID) + "/" + GetString(cateNewsGroup.CateNewsGroupName) + "-" + catenews.GroupCate + ".aspx'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<li><a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a></li>" + s1; } cate += cateNewsGroup.CateNewsGroupName.ToString(); //Sửa lại cate += "</a></li>"; cate += s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else { if (!String.IsNullOrEmpty(cId) && !String.IsNullOrEmpty(g)) { CateNews cateNewsById = catenewsBSO.GetCateNewsById(Convert.ToInt32(cId)); CateNewsGroup groupByGroupCate = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g), Language.language); if (groupByGroupCate != null && cateNewsById != null) { Navigation.TitleName = cateNewsById.CateNewsName; string cate = "<li><a href='" + urlRoot + "c2/" + cateNewsgroupBSO.GetSlugById(groupByGroupCate.CateNewsGroupID) + "/" + GetString(groupByGroupCate.CateNewsGroupName) + "-" + cateNewsById.GroupCate + ".aspx' title='" + groupByGroupCate.CateNewsGroupName + "'>"; string s1 = ""; while (cateNewsById.ParentNewsID != 0) { int parentNewsId = cateNewsById.ParentNewsID; cateNewsById = catenewsBSO.GetCateNewsById(parentNewsId); s1 = "<li><a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(cateNewsById.CateNewsID) + "/" + GetString(cateNewsById.CateNewsName) + "-" + cateNewsById.GroupCate + "-" + cateNewsById.CateNewsID + ".aspx' title='" + cateNewsById.CateNewsName + "'>" + cateNewsById.CateNewsName + "</a></li>" + s1; } cate += groupByGroupCate.CateNewsGroupName.ToString() + "</a></li>" + s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else { if (!String.IsNullOrEmpty(g)) { CateNewsGroup groupByGroupCate = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g), Language.language); Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; if (groupByGroupCate != null) { Navigation.TitleName = groupByGroupCate.CateNewsGroupName; } } } } } }
protected void Page_Load(object sender, EventArgs e) { int cId = 0; if (!String.IsNullOrEmpty(Request["cid"])) { int.TryParse(Request["cid"], out cId); } int gId = 0; if (!String.IsNullOrEmpty(Request["g"])) { int.TryParse(Request["g"], out gId); } hddGroupCate.Value = Convert.ToString(gId); hddCateID.Value = Convert.ToString(cId); if (!IsPostBack) { CateNewsGroupBSO cateNewsGroupBso = new CateNewsGroupBSO(); CateNewsBSO cateNewsBso = new CateNewsBSO(); CateNews cateNewsById = cateNewsBso.GetCateNewsById(cId); CateNewsGroup groupByGroupCate = cateNewsGroupBso.GetCateNewsGroupByGroupCate(gId, Language.language); if (groupByGroupCate != null && cateNewsById != null) { GetCateParentNewsGroup(cId, gId); Page.Title = cateNewsById.CateNewsName; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = cateNewsById.CateNewsName + "," + GetString(cateNewsById.CateNewsName); Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = GetString(cateNewsById.CateNewsName); Page.Header.Controls.Add(_keyWords); } else if (cId == 0) { if (groupByGroupCate != null) { //GetHotNewsGroup(cId, gId); GetCateParentNewsGroup(cId, gId); Page.Title = groupByGroupCate.CateNewsGroupName; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = groupByGroupCate.CateNewsGroupName; Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = groupByGroupCate.CateNewsGroupName + "," + GetString(groupByGroupCate.CateNewsGroupName); Page.Header.Controls.Add(_keyWords); } } } }
private void ViewNewsGroupDetail(int Id) { CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); NewsGroupBSO newsgroupBSO = new NewsGroupBSO(); NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Id); if (newsgroup == null) { Response.Redirect("~/Default.aspx"); } commonBSO commonBSO = new commonBSO(); //Kiem tra neu phan quyen truy cap chuyen muc nay DataTable dtCheckRole = commonBSO.CreateDataView("SELECT FROM tblRoleCate WHERE CateId=" + newsgroup.CateNewsID); if (dtCheckRole != null && dtCheckRole.Rows.Count > 0) { UserValidation m_UserValidation = new UserValidation(); if (m_UserValidation.IsSigned()) { DataTable dtGroupRole = new AdminRolesBSO().GetAdminRolesByUserName(m_UserValidation.UserName); if (dtGroupRole != null && dtGroupRole.Rows.Count > 0) { DataTable dtRoleCate = commonBSO.CreateDataView("SELECT Id FROM tblRoleCate WHERE GroupId IN (SELECT RolesID FROM tblAdminRoles WHERE Admin_UserName = '******') AND CateId=" + newsgroup.CateNewsID); if (dtRoleCate != null && dtRoleCate.Rows.Count > 0) { //Da dang nhap va co quyen xem } else { //Da dang nhap nhung khong co quyen truy cap, chuyen ve trang thong bao; content_notice.Visible = true; content_news.Visible = false; } } } else { //Yeu cau dang nhap Response.Redirect(ResolveUrl("~") + "Dang-nhap.aspx?RetUrl=" + Request.RawUrl); } } ltlTitle.Text = newsgroup.Title; //LabelDate.Text = newsgroup.PostDate.ToString("dd/MM/yyyy");// Convert.ToString(newsgroup.PostDate); ltlDescribe.Text = newsgroup.ShortDescribe; FullDescirbe.Text = newsgroup.FullDescribe; LabelAuthor.Text = newsgroup.Author; txtNewsGroupID.Value = Convert.ToString(newsgroup.NewsGroupID); newsgroupBSO.NewsGroupClickUpdate(Id); NewsGroupFollow(newsgroup.NewsGroupID, newsgroup.CateNewsID); CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID); CateNewsGroup cateNewsGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate, Language.language); title_name.Text = "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a>"; string cate = "<a href='" + ResolveUrl("~/") + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewsGroup.CateNewsGroupID) + "/" + GetString(cateNewsGroup.CateNewsGroupName) + "-" + catenews.GroupCate + ".aspx' class='content_Text_Cat'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'><a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a>" + s1; } cate += cateNewsGroup.CateNewsGroupName.ToString(); //Sửa lại cate += "</a>"; cate += s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.T_home + "</a><img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_cate.Text += cate; if (!String.IsNullOrEmpty(Request["error"])) { error.Text = "<div class='error_register_text'>" + Resources.resource.T_Comment_Error1 + "</div>"; } if (!newsgroup.IsComment) { btnComment.Visible = false; CommentPanel.Visible = false; } else { btnComment.Visible = true; CommentPanel.Visible = true; GetNewsCommentById(Id); } //ViewRegister(Id); //ltlFb_like.Text = "<div class='fb-like' data-href='http://http://tuyensinhtructuyen.edu.vn/ts/" + GetString(newsgroup.Title) + "-" + newsgroup.GroupCate + "-" + newsgroup.NewsGroupID + ".aspx' data-send='true' data-width='670' data-height='65' data-show-faces='true'></div>"; //ltlFb_comment.Text = "<div class='fb-comments' data-href='http://http://tuyensinhtructuyen.edu.vn/ts/" + GetString(newsgroup.Title) + "-" + newsgroup.GroupCate + "-" + newsgroup.NewsGroupID + ".aspx' data-num-posts='10' data-width='670'></div>"; Page.Title = newsgroup.Title; HtmlMeta _desrip = new HtmlMeta(); _desrip.Name = "description"; _desrip.Content = Tool.StripTagsCharArray(newsgroup.ShortDescribe) + " ; " + newsgroup.Title + " , " + (newsgroup.Tags) + " , " + newsgroup.Keyword; Page.Header.Controls.Add(_desrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = newsgroup.Keyword; Page.Header.Controls.Add(_keyWords); }