//绑定数据 private void ShowInfo() { this.lblPid.Text = model.ParentId.ToString(); if (model.ParentId > 0) { this.lblPname.Text = bll.GetChannelTitle(model.ParentId); } else { this.lblPname.Text = "顶级类别"; } this.txtTitle.Text = model.Title; this.txtPageUrl.Text = model.PageUrl; this.txtClassOrder.Text = model.ClassOrder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { chkLoginLevel("addChannel"); //取得栏目传参 if (int.TryParse(Request.Params["kindId"], out kindId)) { if (int.TryParse(Request.Params["classId"], out pId)) { pTitle = bll.GetChannelTitle(pId); } else { pId = 0; } lblPid.Text = pId.ToString(); lblPname.Text = pTitle; txtPageUrl.Text = ChannelUrl((Channel)kindId); } else { JscriptMsg(350, 230, "错误提示", "<b>出现错误啦!</b>您要增加类别的种类不明确或参数不正确。", "back", "Error"); } }
protected void Page_Load(object sender, EventArgs e) { chkLoginLevel("addChannel"); //取得栏目传参 if (int.TryParse(Request.Params["kindId"], out kindId)) { if (int.TryParse(Request.Params["classId"], out pId)) { pTitle = bll.GetChannelTitle(pId); } else { pId = 0; } lblPid.Text = pId.ToString(); lblPname.Text = pTitle; switch (kindId) { case 1: txtPageUrl.Text = "../Article/List.aspx"; break; case 2: txtPageUrl.Text = "../Products/List.aspx"; break; case 3: txtPageUrl.Text = "../Contents/List.aspx"; break; } } else { JscriptMsg(350, 230, "错误提示", "<b>出现错误啦!</b>您要增加类别的种类不明确或参数不正确。", "back", "Error"); } }
/// <summary> /// 递归找到父节点 /// </summary> private void LoopChannelMenu(StringBuilder _strTxt, string _urlKey, int _classId) { DtCms.BLL.Channel bll = new DtCms.BLL.Channel();; int _parentId = bll.GetChannelParentId(_classId); if (_parentId > 0) { this.LoopChannelMenu(_strTxt, _urlKey, _parentId); } _strTxt.Append(" > <a href=\"" + URLRewrite(_urlKey, _classId) + "\">" + bll.GetChannelTitle(_classId) + "</a>"); }