//内容详细页 protected void GetDataDefault(int _id) { List <OS.Model.contents.article> modelLst = new List <OS.Model.contents.article>(); model = new OS.Model.contents.article(); TemplateId = 1; //详细页 if (cId != 0 && _id == 0) { model = bll.GetModel(cId); modelLst.Add(model); if (modelLst != null) { repDetail.DataSource = modelLst; repDetail.DataBind(); } } //单页模板的内容 else { System.Data.DataSet ds = bll.GetList(1, " category_id=" + id + " and status=0 ", "sort_id asc,add_time desc"); if (ds != null) { repDanYe.DataSource = ds; repDanYe.DataBind(); } } }
/// <summary> /// 加载外链接 /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetLinkUrl(string category_id) { string rStr = string.Empty; OS.BLL.contents.article bll = new OS.BLL.contents.article(); OS.Model.contents.article model = new OS.Model.contents.article(); model = bll.GetModel(category_id); if (model != null) { rStr = " <a target=\"_blank\" href=\"" + model.link_url + "\"><img src=\"" + model.img_url + "\" /></a>"; } return(rStr); }
/// <summary> /// 加载外链接 /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetLinkUrl(string category_id) { string rStr = string.Empty; OS.BLL.contents.article bll = new OS.BLL.contents.article(); OS.Model.contents.article model = new OS.Model.contents.article(); model = bll.GetModel(category_id); if (model != null) { rStr = " <a target=\"_blank\" href=\"" + model.link_url + "\"><img src=\"" + model.img_url + "\" /></a>"; } return rStr; }